Skip to content

Conversation

@arturobernalg
Copy link
Member

It introduces directional enforcement inside AbstractH2StreamMultiplexer:

Locally-initiated streams are gated by the peer’s advertised MAX_CONCURRENT_STREAMS.
Remotely-initiated streams exceeding our advertised limit are immediately refused with RST_STREAM(REFUSED_STREAM).
The same inbound check applies to PUSH_PROMISE promised streams.
After applying remote SETTINGS, we request session output so queued commands progress when the peer raises the limit.

Implementation is contained to the multiplexer (no new controller class). Active stream counting ignores terminated streams. Flow control logic remains untouched.TREAM) Add tests for inbound headers, outbound gating, and push-promise refusal; nudge queued opens on SETTINGS ACK

@arturobernalg arturobernalg requested a review from ok2c September 8, 2025 07:56

ioSession.getLock().lock();
try {
if (countActiveLocalInitiated() >= remoteConfig.getMaxConcurrentStreams()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arturobernalg Imagine being a user who wants to push 10 messages to the client being completely unaware of the MAX_CONCURRENT_STREAMS limit imposed by the client and getting some of those messages dropped with some obscure "Outbound stream limit reached" message. What would be your reaction?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ok2c I reworked the patch so we never drop user traffic because of the peer’s MAX_CONCURRENT_STREAMS.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arturobernalg so, the MAX_CONCURRENT_STREAMS does not apply to the server pushed streams, as before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arturobernalg so, the MAX_CONCURRENT_STREAMS does not apply to the server pushed streams, as before?

@ok2c You’re right to call this out. MAX_CONCURRENT_STREAMS does apply to server-initiated streams. my bad

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arturobernalg so, the MAX_CONCURRENT_STREAMS does not apply to the server pushed streams, as before?

@ok2c You’re right to call this out. MAX_CONCURRENT_STREAMS does apply to server-initiated streams. my bad

@arturobernalg You are trying to brute force a fix on an API that simply does not have enough flexibility to support the protocol requirements. As I said before a proper solution to this issue is not possible without an extensive refactoring of the H2 protocol handling code.

@arturobernalg arturobernalg force-pushed the SETTINGS_MAX_CONCURRENT_STREAMS branch from 1af104d to 1d2eccf Compare September 10, 2025 07:08
@arturobernalg arturobernalg requested a review from ok2c September 10, 2025 07:09
@arturobernalg arturobernalg force-pushed the SETTINGS_MAX_CONCURRENT_STREAMS branch 2 times, most recently from 4ff944e to 686f30e Compare September 10, 2025 10:04
Do not count reserved/idle push streams toward concurrency. Refuse on the
first HEADERS that would activate a promised stream when active inbound
streams ≥ peer limit; emit RST_STREAM(REFUSED_STREAM). Keep push() unchanged
(no limit at reservation time).
@arturobernalg arturobernalg force-pushed the SETTINGS_MAX_CONCURRENT_STREAMS branch from e7517fa to 70a7373 Compare September 10, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants