-
Notifications
You must be signed in to change notification settings - Fork 141
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
base: main
Are you sure you want to change the base?
Conversation
const bsl::shared_ptr<mqbi::QueueHandleRequesterContext>& clientContext, | ||
const mqbi::Cluster::OpenQueueCallback& callback) | ||
: d_queueContext_p(0) | ||
, d_domain_p(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.
The domain
might be NULL if we are in the proxy, right?
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.
No, I don't think Proxy can work without a domain
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); |
Signed-off-by: dorjesinpo <[email protected]>
Signed-off-by: dorjesinpo <[email protected]>
Signed-off-by: dorjesinpo <[email protected]>
2f548bf
to
af5e923
Compare
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: