Skip to content

Close HTTP/2 socket on shutdown without active streams - #401

Open
kafkiansky wants to merge 1 commit into
amphp:5.xfrom
kafkiansky:fix/http2-close-idle-connection
Open

kafkiansky wants to merge 1 commit into
amphp:5.xfrom
kafkiansky:fix/http2-close-idle-connection

Conversation

@kafkiansky

Copy link
Copy Markdown

Http2ConnectionProcessor::shutdown() queues GOAWAY and releases the active streams, but the socket is closed only in releaseStream() once the last stream is released. Closing a connection without active streams, e.g. an idle one, therefore only sent GOAWAY and left the socket open until the server closed it, which some servers (grpc-go) never do. The pool also kept waiting for such a connection to close, so the next request to the same authority could hang.

Close the socket once the GOAWAY frame has been written.

Http2ConnectionProcessor::shutdown() queues GOAWAY and releases the active
streams, but the socket is closed only in releaseStream() once the last
stream is released. Closing a connection without active streams, e.g. an
idle one, therefore only sent GOAWAY and left the socket open until the
server closed it, which some servers (grpc-go) never do. The pool also kept
waiting for such a connection to close, so the next request to the same
authority could hang.

Close the socket once the GOAWAY frame has been written.

This branch has not been deployed

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant