Skip to content

Commit 9c5c451

Browse files
committed
removing shutdown v1
Signed-off-by: dorjesinpo <[email protected]>
1 parent 495dc34 commit 9c5c451

28 files changed

+222
-1414
lines changed

src/groups/mqb/mqba/mqba_adminsession.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,9 @@ void AdminSession::tearDown(const bsl::shared_ptr<void>& session,
414414
// 'session' go out of scope.
415415
}
416416

417-
void AdminSession::initiateShutdown(const ShutdownCb& callback,
418-
const bsls::TimeInterval& timeout,
419-
bool supportShutdownV2)
417+
void AdminSession::initiateShutdown(const ShutdownCb& callback)
420418
{
421419
// executed by the *ANY* thread
422-
(void)timeout;
423-
(void)supportShutdownV2;
424420

425421
dispatcher()->execute(
426422
bdlf::BindUtil::bind(&AdminSession::initiateShutdownDispatched,

src/groups/mqb/mqba/mqba_adminsession.h

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

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

254247
/// Make the session abandon any work it has.
255248
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
@@ -476,13 +476,9 @@ void Application::stop()
476476

477477
bool supportShutdownV2 = initiateShutdown();
478478

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

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

@@ -625,10 +620,8 @@ bool Application::initiateShutdown()
625620

626621
for (Sessions::const_iterator cit = clients.begin(); cit != clients.end();
627622
++cit) {
628-
(*cit)->initiateShutdown(bdlf::BindUtil::bind(&bslmt::Latch::arrive,
629-
&latchDownstreams),
630-
shutdownTimeout,
631-
true);
623+
(*cit)->initiateShutdown(
624+
bdlf::BindUtil::bind(&bslmt::Latch::arrive, &latchDownstreams));
632625
}
633626

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

0 commit comments

Comments
 (0)