Skip to content

A client can never hold more than 100 concurrent streams open, no matter how many the server advertises #194

Description

@srjakes

Connection#activate_stream raises StreamLimitExceeded against @local_settings[:settings_max_concurrent_streams] for every stream it activates, including streams the client opens itself.

The effect is that a client can never hold more than 100 concurrent streams open (the DEFAULT_CONNECTION_SETTINGS value), no matter how many the server advertises.

Related issue where consumers of http-2 are working around the issue
ostinelli/apnotic#140

# Activates new incoming or outgoing stream and registers appropriate
# connection managemet callbacks.
def activate_stream(id:, **args)
  connection_error(msg: "Stream ID already exists") if @streams.key?(id)

  raise StreamLimitExceeded if @active_stream_count >= @local_settings[:settings_max_concurrent_streams]

For an incoming stream that check is right. For an outgoing one it applies the wrong endpoint's
limit — and it always binds first, because DEFAULT_CONNECTION_SETTINGS is 100 while servers
commonly advertise considerably more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions