From 3885c14aeffe95cf1b8205811d56800f85f08c6b Mon Sep 17 00:00:00 2001 From: Evgeny Malygin Date: Mon, 29 Jul 2024 18:00:44 +0300 Subject: [PATCH] Fix[MQBBLP]: prevent too much logging in dev build (#380) * 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 * Update mqbblp_queueengineutil.cpp Signed-off-by: Evgeny Malygin * Update mqbblp_queueengineutil.cpp Signed-off-by: Evgeny Malygin * Update mqbblp_queueengineutil.cpp Signed-off-by: Evgeny Malygin --------- Signed-off-by: Evgeny Malygin --- src/groups/mqb/mqbblp/mqbblp_queueengineutil.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/groups/mqb/mqbblp/mqbblp_queueengineutil.cpp b/src/groups/mqb/mqbblp/mqbblp_queueengineutil.cpp index fd8008fc0..e9ab00da5 100644 --- a/src/groups/mqb/mqbblp/mqbblp_queueengineutil.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_queueengineutil.cpp @@ -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() @@ -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 "