[fix][test] Cover scheduler shutdown membership-lock deadlock - #26557
Merged
merlimat merged 3 commits intoSep 13, 2026
Conversation
Assisted-by: Codex (GPT-6)
lhotari
requested review from
Technoboy-,
dao-jun,
david-streamlio,
merlimat and
nodece
September 12, 2026 20:08
merlimat
approved these changes
Sep 13, 2026
Preserve the upstream bounded scheduler shutdown implementation and retain the membership-lock regression test.
lhotari
added a commit
that referenced
this pull request
Sep 14, 2026
(cherry picked from commit 6075c2b)
lhotari
added a commit
that referenced
this pull request
Sep 14, 2026
(cherry picked from commit 6075c2b)
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
PR #26556 fixed the lock-order deadlock in
SchedulerManager.close()and added bounded shutdown for stuck scheduling rounds. Add regression coverage to ensure membership queries can still complete while shutdown waits for the scheduler lock.The deadlock was observed during
PulsarFunctionTlsTest.tearDownin Broker Group 2 in PR #26547: the test worker held the manager monitor while waiting forschedulerLock, while the scheduler heldschedulerLockand waited for the monitor to read membership.Modifications
Add a bounded regression test that holds the exposed scheduler lock, waits until shutdown queues for it, and checks that a membership query can still finish. Verify that the producer remains open until the lock is released and then closes successfully. Cleanup releases the lock even on failure so the test detects the inversion without hanging the test JVM.
This PR retains the shutdown implementation from #26556 and adds only test coverage; it makes no production-code changes.
Verifying this change
Make sure that the change passes the CI checks.
After merging upstream master, all 15 tests in
SchedulerManagerTestpass with retries disabled, including the membership-lock regression test and the upstream stuck-scheduling-round test../gradlew quickCheckpasses.Does this pull request potentially affect one of the following parts: