-
-
Notifications
You must be signed in to change notification settings - Fork 37.1k
closeAllConnections on http2.Http2Server and http2.Http2SecureServer #55459
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.http2Issues and PRs related to the http2 subsystem.Issues and PRs related to the http2 subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Description
Activity
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.http2Issues and PRs related to the http2 subsystem.Issues and PRs related to the http2 subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Type
Projects
- StatusShow more project fieldsTriaged
What is the problem this feature will solve?
I would like to cleanly shut down a running http2 server that has existing client connections. In http.Server, the closeAllConnections method was added for this purpose, but it doesn't seem to have been included in http2 yet.
What is the feature you are proposing to solve the problem?
Add the methose closeAllConnections() and closeIdleConnections to http2.Http2Server and http2.Http2SecureServer.
Alternatively, if an AbortSignal is passed into listen(), all connections could be shut down when the signal fires abort.
What alternatives have you considered?
This code is a workaround:
This is likely suboptimal due to my lack of intimate understanding of the http2 implementation.