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

Shashikant Banerjee commented on RATIS-336:
-------------------------------------------

The patch looks good to me . I am +1 on this.

> LeaderState.isBootStrappingPeer may have NPE
> --------------------------------------------
>
>                 Key: RATIS-336
>                 URL: https://issues.apache.org/jira/browse/RATIS-336
>             Project: Ratis
>          Issue Type: Bug
>          Components: server
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Tsz Wo Nicholas Sze
>            Priority: Major
>         Attachments: r336_20181001.patch
>
>
> {code}
> //LeaderState
>   boolean isBootStrappingPeer(RaftPeerId peerId) {
>     return inStagingState() && getStagingState().contains(peerId);
>   }
>   boolean inStagingState() {
>     return stagingState != null;
>   }
>  
>   ConfigurationStagingState getStagingState() {
>     return stagingState;
>   }
> {code}
> Since stagingState is volatile, it could be set to null between 
> inStagingState() and contains(..).



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

Reply via email to