Skip to content

Commit

Permalink
Handle out-of-order Configure responses (#275)
Browse files Browse the repository at this point in the history
Signed-off-by: dorjesinpo <[email protected]>
  • Loading branch information
dorjesinpo authored May 9, 2024
1 parent 4409e0b commit 4d71a71
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/groups/mqb/mqbblp/mqbblp_relayqueueengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,28 @@ void RelayQueueEngine::applyConfiguration(App_State& app,

app.d_routing_sp->apply();

app.d_routing_sp->registerSubscriptions();
Routers::Consumers& consumers = app.d_routing_sp->d_consumers;

for (Routers::Consumers::const_iterator itConsumer = consumers.begin();
itConsumer != consumers.end();
++itConsumer) {
Routers::Consumer& consumer = consumers.value(itConsumer);
mqbi::QueueHandle* handle = itConsumer->first;

if (!d_queueState_p->handleCatalog().hasHandle(handle)) {
// This can happen with out-of-order Configure responses as in the
// case when network disconnects with two concurrent requests and
// the second gets (error) response before the first one gets
// cancelled.
itConsumer->second.lock()->invalidate();

app.d_priorityCount = app.d_routing_sp->finalize();

continue; // CONTINUE
}

consumer.registerSubscriptions(handle);
}

BALL_LOG_INFO << "For queue '" << d_queueState_p->uri() << "', "
<< "rebuilt highest priority consumers: [count: "
Expand Down

0 comments on commit 4d71a71

Please sign in to comment.