zookeeper icon indicating copy to clipboard operation
zookeeper copied to clipboard

ZOOKEEPER-4541 Ephemeral znode owned by closed session visible in 1 of 3 servers

Open jonmv opened this issue 2 years ago • 28 comments

This fixes two bugs in shutdown logic, in the zookeeper server.

  1. The SendAckRequestProcessor may die when attempting to close its Learner owner's socket, to signal that something went wrong, if the learner already closed the socket because something (the same thing) went wrong (namely, the leader disconnecting). This is fixed by simply checking for nullity.
  2. ZooKeeperServer.shutdown(boolean) is not present in child classes, so many uses here fail to properly shut down child resources, such as the SyncRequestProcessor. This is fixed by refactoring shutdown for the child classes.

A unit test is also added, that fails when either of the two fixes are not present. To be precise, it fails only because the SyncRequestProcessor is never shut down (thread leak), once the first fix is applied; I didn't spend more time looking for other weird failures that may arise from what is obviously a bug anyway.

See ZOOKEEPER-4541 for full details.

jonmv avatar Sep 23 '22 13:09 jonmv