Skip to content

Add stream idle timeout #317

Description

@bjosv

When we ran the client towards a http2 server that misbehaved we saw that we got an ever increasing map of unfinished streams (http2_state.streams, but also http2_state.stream_refs). We noticed that the server did not always respond to our requests, even when using a single TLS connection.

I have seen that some clients for other languages [1] provides a configuration, a stream idle timeout, which would terminate a stream after not receiving any data or response within configured time.

Would it make sense to have a feature like this in Gun or is it up to the user to make sure that non-finished streams are cancelled/terminated using own timeouts? What is your view on this?

Could it make sense to add some guidance in
https://ninenines.eu/docs/en/gun/2.0/guide/http/#_processing_responses

that gun:cancel/2 could be used to terminate a stream that has not yet received any response or a message with the atom fin.
WDYT?

[1]
https://nodejs.org/dist//v9.0.0/docs/api/http2.html#http2_http2stream_settimeout_msecs_callback
https://eclipse.dev/jetty/javadoc/jetty-12/org/eclipse/jetty/http2/client/HTTP2Client.html#setStreamIdleTimeout(long)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions