Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions src/groups/mqb/mqbblp/mqbblp_cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,16 @@ void Cluster::continueShutdownDispatched(

d_clusterOrchestrator.queueHelper().processShutdownEvent();

// Make sure all partitions done sending last sync points.
// Synchronize with all Queue Dispatcher threads
bslmt::Latch latch(1);
dispatcher()->executeOnAllQueues(
mqbi::Dispatcher::VoidFunctor(), // empty
mqbi::DispatcherClientType::e_QUEUE,
bdlf::BindUtil::bindS(d_allocator_p, &bslmt::Latch::arrive, &latch));

latch.wait();

// Notify peers before going down. This should be the last message sent
// out.

Expand All @@ -689,15 +699,8 @@ void Cluster::continueShutdownDispatched(
controlMsg,
d_clusterData.transportManager());

// Make sure all partitions done sending last sync points and advisories.
// Synchronize with all Queue Dispatcher threads
bslmt::Latch latch(1);
dispatcher()->executeOnAllQueues(
mqbi::Dispatcher::VoidFunctor(), // empty
mqbi::DispatcherClientType::e_QUEUE,
bdlf::BindUtil::bindS(d_allocator_p, &bslmt::Latch::arrive, &latch));

latch.wait();
BALL_LOG_INFO << "Cluster: [name: '" << name()
<< "'] done waiting and now will close the channels";

// Close all channels of the associated cluster: when broadcasting the
// state change, the leader, in response, will potentially elect new
Expand Down
Loading