You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Tsz Wo Nicholas Sze (JIRA)" <ji...@apache.org> on 2018/09/25 22:41:00 UTC

[jira] [Comment Edited] (RATIS-311) DeadLock between AppendEntries request and RaftLogWorker

    [ 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)