Skip to content

Commit c2c2d3f

Browse files
authored
Feat: removing shutdown v1 (#784)
Signed-off-by: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com>
1 parent ec376e8 commit c2c2d3f

30 files changed

Lines changed: 231 additions & 1645 deletions

src/groups/mqb/mqba/mqba_adminsession.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,7 @@ void AdminSession::tearDown(BSLA_UNUSED const bsl::shared_ptr<void>& session,
407407
// 'session' go out of scope.
408408
}
409409

410-
void AdminSession::initiateShutdown(
411-
const ShutdownCb& callback,
412-
BSLA_UNUSED const bsls::TimeInterval& timeout,
413-
BSLA_UNUSED bool supportShutdownV2)
410+
void AdminSession::initiateShutdown(const ShutdownCb& callback)
414411
{
415412
// executed by the *ANY* thread
416413

src/groups/mqb/mqba/mqba_adminsession.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,15 +242,8 @@ class AdminSession : public mqbnet::Session, public mqbi::DispatcherClient {
242242
void flush() BSLS_KEYWORD_OVERRIDE;
243243

244244
/// Initiate the shutdown of the session and invoke the specified
245-
/// `callback` upon completion of (asynchronous) shutdown sequence or
246-
/// if the specified `timeout` is expired.
247-
/// The optional (temporary) specified 'supportShutdownV2' indicates
248-
/// shutdown V2 logic which is not applicable to `AdminSession`
249-
/// implementation.
250-
void
251-
initiateShutdown(const ShutdownCb& callback,
252-
const bsls::TimeInterval& timeout,
253-
bool supportShutdownV2 = false) BSLS_KEYWORD_OVERRIDE;
245+
/// `callback` upon completion of (asynchronous) shutdown sequence.
246+
void initiateShutdown(const ShutdownCb& callback) BSLS_KEYWORD_OVERRIDE;
254247

255248
/// Make the session abandon any work it has.
256249
void invalidate() BSLS_KEYWORD_OVERRIDE;

src/groups/mqb/mqba/mqba_application.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,9 @@ void Application::stop()
475475

476476
bool supportShutdownV2 = initiateShutdown();
477477

478-
if (supportShutdownV2) {
479-
BALL_LOG_INFO << ": Executing GRACEFUL_SHUTDOWN_V2";
480-
}
481-
else {
482-
BALL_LOG_INFO << ": Peers do not support "
483-
<< "GRACEFUL_SHUTDOWN_V2. Retreat to V1";
484-
}
478+
BSLS_ASSERT_SAFE(supportShutdownV2);
479+
480+
BALL_LOG_INFO << ": Executing GRACEFUL_SHUTDOWN_V2";
485481

486482
// For each cluster in cluster catalog, inform peers about this shutdown.
487483
int count = d_clusterCatalog_mp->count();
@@ -493,8 +489,7 @@ void Application::stop()
493489
count > 0;
494490
++clusterIt, --count) {
495491
clusterIt.cluster()->initiateShutdown(
496-
bdlf::BindUtil::bind(&bslmt::Latch::arrive, &latch),
497-
supportShutdownV2);
492+
bdlf::BindUtil::bind(&bslmt::Latch::arrive, &latch));
498493
}
499494
latch.wait();
500495

@@ -627,10 +622,8 @@ bool Application::initiateShutdown()
627622

628623
for (Sessions::const_iterator cit = clients.begin(); cit != clients.end();
629624
++cit) {
630-
(*cit)->initiateShutdown(bdlf::BindUtil::bind(&bslmt::Latch::arrive,
631-
&latchDownstreams),
632-
shutdownTimeout,
633-
true);
625+
(*cit)->initiateShutdown(
626+
bdlf::BindUtil::bind(&bslmt::Latch::arrive, &latchDownstreams));
634627
}
635628

636629
// Need to wait for peers to update this node status to guarantee no new

0 commit comments

Comments
 (0)