You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
closeAllConnections on http2.Http2Server and http2.Http2SecureServer #55459
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:
constsocks=newSet();constserver=http2.createSecureServer(...);server.on('connection',(s: Duplex)=>{socks.add(s);once('close',()=>socks.delete(s));});server.on('close',()=>{for(constsofsocks){s.destroy();// Fires close event above, which cleans up.}});
This is likely suboptimal due to my lack of intimate understanding of the http2 implementation.
There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the
never-staleIssues and PRs exempt from automated stale handling.
label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
Activity
github-actions commentedon Apr 18, 2025
There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the never-staleIssues and PRs exempt from automated stale handling.
label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
hildjj commentedon Apr 24, 2025
See #57586, #57668, and #57808 for related changes.
hildjj commentedon Apr 24, 2025
I think this is fixed by 609df89#diff-ac5af2e03d6e50747ae181d62ebb939ee884b05c70c42aa7297fb7323b3e6639