-
Notifications
You must be signed in to change notification settings - Fork 143
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
Feat: CQH calls Queue::getHandle #565
Conversation
QueueLiveState& qinfo = context.d_queueContext_p->d_liveQInfo; | ||
const int pid = context.d_queueContext_p->partitionId(); | ||
QueueLiveState& qinfo = context->d_queueContext_p->d_liveQInfo; | ||
const int pid = context->d_queueContext_p->partitionId(); |
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.
Here we also dereference context->d_queueContext_p
without proper checks
@@ -1141,12 +1161,12 @@ void ClusterQueueHelper::onOpenQueueResponse( | |||
failure = false; | |||
} | |||
|
|||
QueueContext& qcontext = *context.d_queueContext_p; | |||
QueueContext& qcontext = *context->d_queueContext_p; |
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.
Dereferencing
QueueLiveState& qinfo = queueContext->d_liveQInfo; | ||
const int pid = queueContext->partitionId(); | ||
const bool isPrimary = !d_cluster_p->isRemote() && | ||
d_clusterState_p->isSelfPrimary(pid); | ||
bsl::shared_ptr<mqbi::Queue> queue = createQueueFactory(errorDescription, | ||
context, | ||
*context, |
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.
Missing check before that context is not a null shared ptr
@@ -89,8 +89,7 @@ namespace mqbblp { | |||
// ============ | |||
|
|||
/// Domain implementation | |||
class Domain BSLS_KEYWORD_FINAL : public mqbi::Domain, | |||
public mqbc::ClusterStateObserver { | |||
class Domain : public mqbi::Domain { |
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.
class Domain : public mqbi::Domain { | |
class Domain BSLS_KEYWORD_FINAL : public mqbi::Domain { |
6e95521
to
2f548bf
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 440 of commit 2f548bf has completed with FAILURE
, d_callback(callback) | ||
{ | ||
BSLS_ASSERT_SAFE(domain); | ||
// NOTHING |
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.
// NOTHING |
{ | ||
QueueLiveState& info = context->d_queueContext_p->d_liveQInfo; | ||
QueueLiveState& info = context->queueContext()->d_liveQInfo; |
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.
Might rely on the checks done before calling this function, or might add them here as well
QueueLiveState& info = context->queueContext()->d_liveQInfo; | |
// executed by the cluster *DISPATCHER* thread | |
// PRECONDITIONS | |
BSLS_ASSERT_SAFE(context); | |
BSLS_ASSERT_SAFE(context->queueContext()); | |
QueueLiveState& info = context->queueContext()->d_liveQInfo; |
|
||
const int pid = context.d_queueContext_p->partitionId(); | ||
QueueContext* queueContext = context.queueContext(); |
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.
QueueContext* queueContext = context.queueContext(); | |
BSLS_ASSERT_SAFE(context); | |
QueueContext* queueContext = context.queueContext(); | |
BSLS_ASSERT_SAFE(queueContext); |
2f548bf
to
af5e923
Compare
Signed-off-by: dorjesinpo <[email protected]>
Signed-off-by: dorjesinpo <[email protected]>
af5e923
to
de99d90
Compare
Signed-off-by: dorjesinpo <[email protected]>
de99d90
to
b6777a5
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.
Let's run sanitizers and merge, the UT failure is unrelated
* CQH calls Queue::getHandle Signed-off-by: dorjesinpo <[email protected]> * Asserts... Signed-off-by: dorjesinpo <[email protected]> * more asserts Signed-off-by: dorjesinpo <[email protected]> --------- Signed-off-by: dorjesinpo <[email protected]>
For the upcoming Dynamic Apps feature, we need
ClusterQueueHelper
to be the caller ofQueue::getHandle
(and inspect the status to make Dynamic Apps updates if necessary).So, instead of
Domain
callingQueue::getHandle
afterCluster::openQueue
, it is theCluster
(ClusterQueueHelper
) callingQueue::getHandle
as part ofCluster::openQueue
.Roughly, the sequence looks like this: