[ 
https://issues.apache.org/jira/browse/RATIS-311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16628017#comment-16628017
 ] 

Tsz Wo Nicholas Sze edited comment on RATIS-311 at 9/25/18 10:40 PM:
---------------------------------------------------------------------

Thanks [~zander].  How about removing synchronized and using Optional to handle 
the null case as below?
{code}
//RaftServerImpl
  public void submitLocalSyncEvent() {
    Optional.ofNullable(leaderState).ifPresent(ls -> 
ls.submitUpdateStateEvent(LeaderState.UPDATE_COMMIT_EVENT));
  }
{code}


was (Author: szetszwo):
Thanks [~zander].  How about removing synchronized and using Optional to handle 
the null case as below?
{code}
  public void submitLocalSyncEvent() {
    Optional.ofNullable(leaderState).ifPresent(ls -> 
ls.submitUpdateStateEvent(LeaderState.UPDATE_COMMIT_EVENT));
  }
{code}

> DeadLock between AppendEntries request and RaftLogWorker
> --------------------------------------------------------
>
>                 Key: RATIS-311
>                 URL: https://issues.apache.org/jira/browse/RATIS-311
>             Project: Ratis
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 0.2.0
>            Reporter: dongeforever
>            Priority: Critical
>         Attachments: image-2018-09-07-15-32-03-392.png, 
> image-2018-09-07-15-33-05-459.png
>
>
> !image-2018-09-07-15-32-03-392.png!
>  
> !image-2018-09-07-15-33-05-459.png!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to