Deprecate Broker::congestion_queue_size and stop using it internally

Since a reorg in the Broker library (commit b04195183) that revamped flow
control and that we pulled in with Zeek 5.0, this setting hasn't done
anything. Broker's endpoint::make_subscriber() and
endpoint::make_status_subscriber() take a queue size argument (with a default
value) that simply gets dropped in the eventual subscriber::make() call. See:

b041951835 (diff-5c0d2baa7981caeb6a4080708ddca6ad929746d10c73d66598e46d7c2c03c8deL34-R178)
This commit is contained in:
Christian Kreibich 2025-04-24 16:07:26 -07:00
parent c1a5f70df8
commit 5008f586ea
2 changed files with 4 additions and 7 deletions

View file

@ -72,7 +72,7 @@ export {
## The number of buffered messages at the Broker/CAF layer after which
## a subscriber considers themselves congested (i.e. tune the congestion
## control mechanisms).
const congestion_queue_size = 200 &redef;
const congestion_queue_size = 200 &redef &deprecated="Remove in v8.1. Non-functional since v5.0";
## The max number of log entries per log stream to batch together when
## sending log messages to a remote logger.

View file

@ -404,11 +404,9 @@ class BrokerState {
public:
using LogSeverityLevel = Observer::LogSeverityLevel;
BrokerState(broker::configuration config, size_t congestion_queue_size, LoggerQueuePtr queue,
PeerBufferStatePtr pbstate)
BrokerState(broker::configuration config, LoggerQueuePtr queue, PeerBufferStatePtr pbstate)
: endpoint(std::move(config), telemetry_mgr->GetRegistry()),
subscriber(
endpoint.make_subscriber({broker::topic::statuses(), broker::topic::errors()}, congestion_queue_size)),
subscriber(endpoint.make_subscriber({broker::topic::statuses(), broker::topic::errors()})),
loggerQueue(std::move(queue)),
peerBufferState(std::move(pbstate)) {
peerBufferState->SetEndpoint(&endpoint);
@ -594,8 +592,7 @@ void Manager::DoInitPostScript() {
auto observer = std::make_shared<Observer>(adapterVerbosity, queue, pbstate);
broker::logger(observer); // *must* be called before creating the BrokerState
auto cqs = get_option("Broker::congestion_queue_size")->AsCount();
bstate = std::make_shared<BrokerState>(std::move(config), cqs, queue, pbstate);
bstate = std::make_shared<BrokerState>(std::move(config), queue, pbstate);
bstate->logSeverity = static_cast<BrokerSeverityLevel>(logSeverityVal);
bstate->stderrSeverity = static_cast<BrokerSeverityLevel>(stderrSeverityVal);