Repository navigation
[fix] Prevent blocked follower elections from delaying AuditorElector shutdown - #4914
Closed
void-ptr974 wants to merge 1 commit into
Closed
void-ptr974 wants to merge 1 commit into
void-ptr974 wants to merge 1 commit into
Conversation
1 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
AuditorElector.shutdown()queues manager cleanup behind the blocking election task on the same single-thread executor. A follower waiting for leadership therefore prevents cleanup until the hardcoded ten-second timeout interrupts the worker.That interruption does not establish task completion. Election can return and construct/start an Auditor while resources are being closed, and concurrent shutdown callers can return before the first caller finishes cleanup.
Changes
ownBkc=false) and the existing log-only handling of close failures, while still attempting subsequent supported close operations.Validation
29 tests passed: 16 new elector lifecycle tests, 5 new ZooKeeper manager tests, and the existing
AuditorBookieTest(5) andAutoRecoveryMainTest(3). Checkstyle, Apache Rat, Spotless and SpotBugs passed.Static checks used the same module/profile selection:
mvn -ntp -P'!mac,!cargo-zigbuild' -pl bookkeeper-server -am \ apache-rat:check spotless:check spotbugs:check -DskipTestsThe native build profiles were disabled for these local Java lifecycle checks on macOS. The full project test suite was not run locally.
Scope
Manager implementations must follow the documented cancellation contract:
close()may wait for admitted metadata operations, but must return independently of the election invocation; remaining waits must respond to close or interruption. This does not terminate arbitrary uninterruptible waits in external implementations; the Pulsar manager requires its own fix.Completion covers election exit and the existing supported close operations. This change does not add failure-unwinding inside Auditor constructors or strengthen Auditor.shutdown()'s internal handling of close failures.