Skip to content

http server.headersTimeout keeps the socket open after timeout #26165

Description

@mariusgrigaitis
  • Version: v11.6.0
  • Platform: Darwin Mariuss-MBP-2.lan 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64 x86_64
  • Subsystem: http

In case timeout is reached for server.headersTimeout, node keeps the socket open until it receives data or server.timeout is reached.

I believe this issue causes dropped connections / 502 errors on AWS ALB (load balancer), because it tries to send data and socket closes immediately after data is received.

I have set server.headersTimeout = 10 * 1000 and ran tcpdump to confirm.

image

As you can see in the dump, 24 seconds has passed, data was received, acknowledged and socket closed after data was received.

I expected socket to be closed after 10 seconds has passed without data.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues and PRs related to the http subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions