@@ -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