Skip to content

Set default H2 session timeout #1206

Closed
@AllanZhengYP

Description

@AllanZhengYP

Is your feature request related to a problem? Please describe.
If a service supports H2, the client will contain an H2 request handler by default (i.e. kinesis, but current released client-kinesis uses H1 request handler still). If user make a request, the process doesn't return after the request is completed, unless the request handler is explicitly destroyed.

This is because the H2 request creates an H2 session everytime it establish an H2 connection. Since the connection doesn't close even in idle, the process doesn't return either.

It brings the problem that:

  1. If someone spawn a process calling a Kinesis API, the process will hang there indefinitely after the API call is completed.
  2. If an H1 service later release H2 support, SDK will use H2 http handler accross the service. It would be a breaking change if we ask users to destroy the handler later.

Describe the solution you'd like
Nodejs provides a setTimeout() config on H2 session object. It configs the session to be closed after a certain period of time if it's inactive. By default, there's no timeout.(It has 3 mins default timeout in reality because NginX has default 3 mins idle time)

I suggest the default value to be shorter than 3 mins so it won't hang users process meaninglessly for too long. The defautl value should be longer than couple of seconds otherwise we are losing the benefit of H2.

/cc @trivikr @alexforsyth

Metadata

Metadata

Assignees

No one assigned

    Labels

    High Priorityfeature-requestNew feature or enhancement. May require GitHub community feedback.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions