-
Notifications
You must be signed in to change notification settings - Fork 141
Feat: removing shutdown v1 #784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This is exciting. |
9c5c451
to
ed55a70
Compare
Signed-off-by: dorjesinpo <[email protected]>
ed55a70
to
5a135bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build 2770 of commit 5a135bd has completed with FAILURE
BMQTST_ASSERT_EQ(callbackCounter, 1); | ||
} | ||
|
||
PV("Shutdown with unconfirmed messages and timeout"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why these UTs are gone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because ClientSession
is not in the business of waiting for unconfirmed messages
initiateShutdown(const VoidFunctor& callback, | ||
bool supportShutdownV2 = false) BSLS_KEYWORD_OVERRIDE; | ||
/// sequence. Execute shutdown logic where upstream (not downstream) nodes | ||
/// deconfigure queues and the shutting down node waits for CONFIRMS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// deconfigure queues and the shutting down node waits for CONFIRMS. | |
/// deconfigure queues and the shutting down node waits for CONFIRMS. |
<< ": invalid cluster name in the StopRequest from " | ||
<< source->nodeDescription() << ", " << request; | ||
return; // RETURN | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it's worth adding a warning and early return if someone sends bmqp::Protocol::eStopRequestVersion::e_V1
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question. this PR is based on the assumption of never having v1. At some point, we need to retire stopRequest.version
.
// Add callback to be invoked once V1 shuts down all client sessions or | ||
// V2 finishes waiting for unconfirmed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Add callback to be invoked once V1 shuts down all client sessions or | |
// V2 finishes waiting for unconfirmed | |
// Add callback to be invoked once V2 finishes waiting for unconfirmed |
initiateShutdown(const VoidFunctor& callback, | ||
bool supportShutdownV2 = false) BSLS_KEYWORD_OVERRIDE; | ||
/// invoked. Execute shutdown logic where upstream (not downstream) nodes | ||
/// deconfigure queues and the shutting down node waits for CONFIRMS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// deconfigure queues and the shutting down node waits for CONFIRMS. | |
/// deconfigure queues and the shutting down node waits for CONFIRMS. |
@@ -321,8 +321,7 @@ int Cluster::start(BSLA_UNUSED bsl::ostream& errorDescription) | |||
return 0; | |||
} | |||
|
|||
void Cluster::initiateShutdown(BSLA_UNUSED const VoidFunctor& callback, | |||
BSLA_UNUSED bool supportShutdownV2) | |||
void Cluster::initiateShutdown(BSLA_UNUSED const VoidFunctor& callback) | |||
{ | |||
// PRECONDITIONS | |||
BSLS_ASSERT_OPT(!d_isStarted && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition here looks odd, and the comment start() can only be called once on this object
is irrelevant to shutdown.
Do we set d_isStarted = false
before we call Cluster::initiateShutdown
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an (old) bug. We never call mqbmock::Cluster::initiateShutdown
We can change this to
BSLS_ASSERT_OPT(d_isStarted &&
"start() must be called before initiateShutdown")
bsls::Types::Int64 | ||
countUnconfirmed(unsigned int subId) BSLS_KEYWORD_OVERRIDE; | ||
/// Return number of unconfirmed messages across all handles. | ||
bsls::Types::Int64 countUnconfirmed() BSLS_KEYWORD_OVERRIDE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bsls::Types::Int64 countUnconfirmed() BSLS_KEYWORD_OVERRIDE; | |
bsls::Types::Int64 countUnconfirmed() const BSLS_KEYWORD_OVERRIDE; |
@@ -245,7 +245,7 @@ Queue::setStats(const bsl::shared_ptr<mqbstat::QueueStatsDomain>& stats) | |||
d_stats_sp = stats; | |||
} | |||
|
|||
bsls::Types::Int64 Queue::countUnconfirmed(BSLA_UNUSED unsigned int subId) | |||
bsls::Types::Int64 Queue::countUnconfirmed() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bsls::Types::Int64 Queue::countUnconfirmed() | |
bsls::Types::Int64 Queue::countUnconfirmed() const |
BSLA_UNUSED const ShutdownCb& callback, | ||
BSLA_UNUSED const bsls::TimeInterval& timeout, | ||
BSLA_UNUSED bool supportShutdownV2) | ||
void DummySession::initiateShutdown(const ShutdownCb& callback) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void DummySession::initiateShutdown(const ShutdownCb& callback) | |
void DummySession::initiateShutdown(BSLA_UNUSED const ShutdownCb& callback) |
void initiateShutdown(const ShutdownCb& callback, | ||
const bsls::TimeInterval& timeout, | ||
bool supportShutdownV2 = false) BSLS_KEYWORD_OVERRIDE | ||
void initiateShutdown(const ShutdownCb& callback) BSLS_KEYWORD_OVERRIDE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void initiateShutdown(const ShutdownCb& callback) BSLS_KEYWORD_OVERRIDE | |
void initiateShutdown(BSLA_UNUSED const ShutdownCb& callback) BSLS_KEYWORD_OVERRIDE |
this is intended to remove the previous shutdown logic assuming shutdown v2 is everywhere