Skip to content

Commit f0092a9

Browse files
committed
send UNAVAILABLE advisory last
Signed-off-by: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com>
1 parent 1f6dd31 commit f0092a9

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

src/groups/mqb/mqbblp/mqbblp_cluster.cpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,16 @@ void Cluster::continueShutdownDispatched(
672672

673673
d_clusterOrchestrator.queueHelper().processShutdownEvent();
674674

675+
// Make sure all partitions done sending last sync points.
676+
// Synchronize with all Queue Dispatcher threads
677+
bslmt::Latch latch(1);
678+
dispatcher()->executeOnAllQueues(
679+
mqbi::Dispatcher::VoidFunctor(), // empty
680+
mqbi::DispatcherClientType::e_QUEUE,
681+
bdlf::BindUtil::bindS(d_allocator_p, &bslmt::Latch::arrive, &latch));
682+
683+
latch.wait();
684+
675685
// Notify peers before going down. This should be the last message sent
676686
// out.
677687

@@ -689,15 +699,8 @@ void Cluster::continueShutdownDispatched(
689699
controlMsg,
690700
d_clusterData.transportManager());
691701

692-
// Make sure all partitions done sending last sync points and advisories.
693-
// Synchronize with all Queue Dispatcher threads
694-
bslmt::Latch latch(1);
695-
dispatcher()->executeOnAllQueues(
696-
mqbi::Dispatcher::VoidFunctor(), // empty
697-
mqbi::DispatcherClientType::e_QUEUE,
698-
bdlf::BindUtil::bindS(d_allocator_p, &bslmt::Latch::arrive, &latch));
699-
700-
latch.wait();
702+
BALL_LOG_INFO << "Cluster: [name: '" << name()
703+
<< "'] done waiting and now will close the channels";
701704

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

0 commit comments

Comments
 (0)