@@ -224,6 +224,18 @@ void ClusterQueueHelper::finishOpening(
224224 BSLS_ASSERT_SAFE (openQueueContext_sp);
225225 BSLS_ASSERT_SAFE (openQueueContext_sp->d_queueContext_p );
226226
227+ // First step in this routine is to update the cookie with the queue handle
228+ // if 'confirmationCookie' is valid. If this open-queue request has
229+ // succeeded, this object should eventually set 'confirmationCookie' to 0
230+ // (see 'onGetQueueHandleDispatched'). Note that this also applies to the
231+ // 'mqba::ClientSession' case ('onQueueOpenCb'). The rough equivalent
232+ // of a client session here is the cluster node session represented by
233+ // 'requester'.
234+
235+ if (confirmationCookie) {
236+ confirmationCookie->d_handle = queueHandle;
237+ }
238+
227239 const OpenQueueContext& openQueueContext = *openQueueContext_sp;
228240
229241 openQueueContext.d_callback (status,
@@ -1408,7 +1420,7 @@ void ClusterQueueHelper::onOpenQueueResponse(
14081420 }
14091421
14101422 // 'createQueue' always calls 'onGetQueueHandle' which calls
1411- // 'finishOpenQueueRequest '.
1423+ // 'finishOpening '.
14121424 return ; // RETURN
14131425 }
14141426
@@ -2097,14 +2109,18 @@ void ClusterQueueHelper::onOpenQueueConfirmationCookieReleased(
20972109 // in); but upstream was a success, so we need to rollback and issue a
20982110 // closeQueue.
20992111
2100- BMQ_LOGTHROTTLE_WARN
2112+ BMQ_LOGTHROTTLE_ERROR
21012113 << d_cluster_p->description ()
21022114 << " : OpenQueueConfirmationCookie released without "
21032115 << " successful processing from the requester. Queue handle "
21042116 << " ptr [" << handle << " ], client ptr [" << handle->client ()
21052117 << " ], handle parameters: " << handleParameters << " ." ;
2106- handle->clearClient (false );
2107- handle->drop ();
2118+
2119+ // Roll back exactly 'handleParameters'.
2120+ // Cannot drop the handle as it can have other substreams.
2121+ handle->release (handleParameters,
2122+ false ,
2123+ mqbi::QueueHandle::HandleReleasedCallback ());
21082124}
21092125
21102126bool ClusterQueueHelper::createQueue (
@@ -2766,18 +2782,6 @@ void ClusterQueueHelper::onGetQueueHandle(
27662782
27672783 BSLS_ASSERT_SAFE (context);
27682784
2769- // First step in this routine is to update the cookie with the queue handle
2770- // if 'confirmationCookie' is valid. If this open-queue request has
2771- // succeeded, this object should eventually set 'confirmationCookie' to 0
2772- // (see 'onGetQueueHandleDispatched'). Note that this also applies to the
2773- // 'mqba::ClientSession' case ('onQueueOpenCb'). The rough equivalent
2774- // of a client session here is the cluster node session represented by
2775- // 'requester'.
2776-
2777- if (confirmationCookie) {
2778- confirmationCookie->d_handle = queueHandle;
2779- }
2780-
27812785 d_cluster_p->dispatcher ()->execute (
27822786 bdlf::BindUtil::bindS (d_allocator_p,
27832787 &ClusterQueueHelper::finishOpening,
0 commit comments