-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure streams are closed on connection close #787
Conversation
1953175
to
e6ca831
Compare
CI failures are currently due to the latest release of node 15 on current. We'll resolve those separately. |
connection.stat.status = 'closed' | ||
this.onConnectionEnd(connection) | ||
// Wait for close to finish before notifying of the closure | ||
(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this anonymous function throw? The error needs to be handled if so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in theory the connection.close could throw although that should be rare. Good catch, a handler for this to log the error
npm 7 broke how we're doing some dev testing, #790, so I've locked ci on Node 14 for now to avoid the CI failures. |
This patch ensures that whenever a connection is closed, any remaining streams on the connection are aborted.