Uh oh!
There was an error while loading. Please reload this page.
[#690] Fix finalizeWorkQueue never cancelling queued operations - #691
Merged
vharseko merged 1 commit intoJul 9, 2026
Merged
Conversation
TraditionalWorkQueue.finalizeWorkQueue() intended to drain the pending operation queue and send a "server shutting down" cancel response to every queued operation, but it called opQueue.removeAll(pendingOperations) with a freshly created empty list, which removes nothing and leaves the list empty, so the abort loop never ran. Operations still queued at shutdown were silently dropped and their clients never received a response. Use drainTo() as intended. The bug dates back to the original OpenDS implementation. FixesOpenIdentityPlatform#690
maximthomas
approved these changes
Jul 5, 2026
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Problem
TraditionalWorkQueue.finalizeWorkQueue()is supposed to drain the pending operation queue at shutdown and send a "server shutting down" cancel response to every queued operation. Instead it calls:Collection.removeAll(c)removes from the queue the elements contained in the argument — and the argument is a freshly created empty list, so nothing is removed and the list stays empty.removeAllnever populates its argument, so the abort loop below is dead code: operations still queued at shutdown are silently dropped and their clients never receive a response (they wait until the connection is torn down).The bug dates back to the original OpenDS implementation — the same pattern is present in the pre-OpenDJ-3
TraditionalWorkQueue— and went unnoticed because the queue is usually empty at shutdown.Fix
Use
opQueue.drainTo(pendingOperations), which moves all queued operations into the list so that each one gets aborted with the shutdownCancelRequest, as the surrounding code and comments intend.Verification
TraditionalWorkQueueTestCase: 6/6 pass.Fixes#690