Skip to content

Commit

Permalink
Fix[MQBBLP]: prevent too much logging in dev build (bloomberg#380)
Browse files Browse the repository at this point in the history
* Fix[MQBBLP]: prevent too much logging in dev build

During throughput tests on a dev version, there are too many messages which flood the log files:
```
25JUL2024_16:23:39.267 (140702256199424) INFO mqbblp_queueengineutil.cpp:1335 Queue 'bmq://bmq.capmon.priority/test0', appId = '__default' does not have any subscription capacity; early exits delivery at 671ACA0000258660D57C053ED92D2F97
```

Signed-off-by: Evgeny Malygin <[email protected]>

* Update mqbblp_queueengineutil.cpp

Signed-off-by: Evgeny Malygin <[email protected]>

* Update mqbblp_queueengineutil.cpp

Signed-off-by: Evgeny Malygin <[email protected]>

* Update mqbblp_queueengineutil.cpp

Signed-off-by: Evgeny Malygin <[email protected]>

---------

Signed-off-by: Evgeny Malygin <[email protected]>
  • Loading branch information
678098 authored and alexander-e1off committed Oct 24, 2024
1 parent e02435d commit 3885c14
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/groups/mqb/mqbblp/mqbblp_queueengineutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,14 @@ QueueEngineUtil_AppState::QueueEngineUtil_AppState(
d_autoSubscription.d_evaluationContext_p =
&d_routing_sp->d_queue.d_evaluationContext;

d_throttledEarlyExits.initialize(1, 5 * bdlt::TimeUnitRatio::k_NS_PER_S);
const mqbcfg::AppConfig& brkrCfg = mqbcfg::BrokerConfig::get();
const int maxActionsPerInterval = (brkrCfg.brokerVersion() ==
bmqp::Protocol::k_DEV_VERSION)
? 32
: 1;

d_throttledEarlyExits.initialize(maxActionsPerInterval,
5 * bdlt::TimeUnitRatio::k_NS_PER_S);
}

QueueEngineUtil_AppState::~QueueEngineUtil_AppState()
Expand Down Expand Up @@ -1329,10 +1336,8 @@ Routers::Result QueueEngineUtil_AppState::selectConsumer(
Routers::Result result = d_routing_sp->selectConsumer(visitor,
currentMessage);
if (result == Routers::e_NO_CAPACITY_ALL) {
const mqbcfg::AppConfig& brkrCfg = mqbcfg::BrokerConfig::get();
if (brkrCfg.brokerVersion() == bmqp::Protocol::k_DEV_VERSION ||
d_throttledEarlyExits.requestPermission()) {
BALL_LOG_INFO << "Queue '" << d_queue_p->description()
if (d_throttledEarlyExits.requestPermission()) {
BALL_LOG_INFO << "[THROTTLED] Queue '" << d_queue_p->description()
<< "', appId = '" << d_appId
<< "' does not have any subscription "
"capacity; early exits delivery at "
Expand Down

0 comments on commit 3885c14

Please sign in to comment.