Fix[mqb]: Always call onHandleConfiguredDispatched - #1685
Merged
Conversation
Signed-off-by: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com>
678098
approved these changes
Aug 3, 2026
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.
⏺ Root cause
Queue::onHandleDeconfigured (mqbblp_queue.cpp:72) asserts it's running on the queue's own dispatcher thread. But it's being invoked as a side effect of
a shared_ptrRelayQueueEngine::ConfigureContext destructing on the cluster dispatcher thread instead.
Chain of events:
callback, mqbblp_relayqueueengine.h:629-656) into the response callback of an upstream configure-queue request, along with a weak_ptr to the engine
itself.
the weak one held by the in-flight request, so this race is expected/normal.
RelayQueueEngine::onHandleConfigured (mqbblp_relayqueengine.cpp:327-357) runs, self.lock() fails (engine is gone), and it does an early return — without
re-dispatching context onto the queue's own thread the way the success path does (onHandleConfiguredDispatched).
RequestManagerRequest::~RequestManagerRequest() (bmqp_requestmanager.h:947-966) tears down and releases it — still on the cluster thread —
~ConfigureContext() fires synchronously, calls its stored callback, which reaches Queue::onHandleDeconfigured, and trips
BSLS_ASSERT_SAFE(inDispatcherThread()).