Wire ipc_write_buffer through to TCP transport per-stream cap - #69962
Open
dwoz wants to merge 1 commit into
Open
Wire ipc_write_buffer through to TCP transport per-stream cap#69962dwoz wants to merge 1 commit into
dwoz wants to merge 1 commit into
Conversation
…ack#69930) The ipc_write_buffer master option was left in the config schema after the legacy salt.transport.ipc module was removed in 3008.x, but was no longer read by any code path -- so setting it in master.conf was a silent no-op. Without a per-stream cap, a slow/blocked event-bus subscriber lets Tornado's per-connection outbound IOStream write buffer grow without bound, driving RSS growth on masters under sustained event churn. Apply the configured value as ``max_write_buffer_size`` on the Tornado IOStream in: - PubServer.handle_stream (plaintext subscribers) - PubServer._validate_ssl_and_add_client (SSL-delayed subscribers) - SaltMessageServer.handle_stream (request/reply clients) The default (unset / 0) preserves the existing unlimited-buffer behavior; operators opt in by setting an explicit byte value.
twangboy
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #69930.
Summary
The
ipc_write_buffermaster option was left in the config schema after the legacysalt.transport.ipcmodule was removed in 3008.x, but was no longer read by any code path -- setting it inmaster.confwas a silent no-op. Without a per-stream cap, a slow/blocked event-bus subscriber lets Tornados per-connection outboundIOStream` write buffer grow without bound, driving RSS growth on masters under sustained event churn.Apply
opts["ipc_write_buffer"]asmax_write_buffer_sizeon the TornadoIOStreamin:PubServer.handle_stream(plaintext subscribers)PubServer._validate_ssl_and_add_client(SSL-delayed subscribers)SaltMessageServer.handle_stream(request/reply clients)The default (unset /
0) preserves the existing unlimited-buffer behavior; operators opt in by setting an explicit byte value.Test plan
tests/pytests/unit/transport/test_tcp.py-- new cases assert the cap is applied on bothSaltMessageServerandPubServerstreams and that the unset/zero path leaves the stream untouched (5 new tests, all 47 in file pass).