Skip to content

Commit

Permalink
Fix[mqbblp_remotequeue.cpp]: crash in RemoteQueue::close (#563)
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeny Malygin <[email protected]>
  • Loading branch information
678098 authored Jan 10, 2025
1 parent 88fe620 commit e9661a3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/groups/mqb/mqbblp/mqbblp_remotequeue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,12 @@ void RemoteQueue::close()
// (unless StopRequest has timed out) all downstreams have closed all
// queues.

// `close()` might be called multiple times
if (!d_self.isValid()) {
return; // RETURN
}
d_self.invalidate();

size_t numMessages = erasePendingMessages(d_pendingMessages.end());

BALL_LOG_INFO << d_state_p->uri() << ": erased all " << numMessages
Expand All @@ -588,7 +594,6 @@ void RemoteQueue::close()

BSLS_ASSERT_SAFE(d_pendingMessages.size() == 0);

d_self.invalidate();
if (d_pendingMessagesTimerEventHandle) {
scheduler()->cancelEventAndWait(&d_pendingMessagesTimerEventHandle);
// 'expirePendingMessagesDispatched' does not restart timer if
Expand Down

0 comments on commit e9661a3

Please sign in to comment.