Skip to content

Wire ipc_write_buffer through to TCP transport per-stream cap - #69962

Open
dwoz wants to merge 1 commit into
saltstack:3008.xfrom
dwoz:dwoz/fix/69930-ipc-write-buffer-wire-through
Open

Wire ipc_write_buffer through to TCP transport per-stream cap#69962
dwoz wants to merge 1 commit into
saltstack:3008.xfrom
dwoz:dwoz/fix/69930-ipc-write-buffer-wire-through

Conversation

@dwoz

@dwoz dwoz commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #69930.

Summary

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 -- setting it in master.conf was a silent no-op. Without a per-stream cap, a slow/blocked event-bus subscriber lets Tornados per-connection outbound IOStream` write buffer grow without bound, driving RSS growth on masters under sustained event churn.

Apply opts["ipc_write_buffer"] 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.

Test plan

  • Unit tests: tests/pytests/unit/transport/test_tcp.py -- new cases assert the cap is applied on both SaltMessageServer and PubServer streams and that the unset/zero path leaves the stream untouched (5 new tests, all 47 in file pass).

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants