zookeeper icon indicating copy to clipboard operation
zookeeper copied to clipboard

ZOOKEEPER-2488: Synchronized access to shuttingDownLE in QuorumPeer

Open mkedwards opened this issue 6 years ago • 4 comments

I think this can be reviewed separately from the (functionally somewhat related) changes in #707.

mkedwards avatar Nov 26 '18 07:11 mkedwards

retest this please

mkedwards avatar Nov 26 '18 23:11 mkedwards

@hanm Do you accept this patch? (you reported the jira)

anmolnar avatar Jan 07 '19 14:01 anmolnar

@hanm A previous patch has already made shuttingDownLE volatile. Do you think we still need to make it synchronized?

anmolnar avatar Apr 01 '20 19:04 anmolnar

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.

hanm avatar Apr 02 '20 04:04 hanm