zookeeper
zookeeper copied to clipboard
ZOOKEEPER-2488: Synchronized access to shuttingDownLE in QuorumPeer
I think this can be reviewed separately from the (functionally somewhat related) changes in #707.
retest this please
@hanm Do you accept this patch? (you reported the jira)
@hanm A previous patch has already made shuttingDownLE
volatile.
Do you think we still need to make it synchronized?
patch LGTM; synchronized on QuorumPeer
when accessing shuttingDownLE
is easy to reason and understand over other solutions like making shuttingDownLE
volatile, which might work but is not so obvious and sounds fragile if access pattern or other parts of the code changed in future.