Skip to content
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

Merged
merged 4 commits into from
Oct 22, 2020

Conversation

jacobheun
Copy link
Contributor

@jacobheun jacobheun commented Oct 20, 2020

This patch ensures that whenever a connection is closed, any remaining streams on the connection are aborted.

@jacobheun jacobheun marked this pull request as ready for review October 21, 2020 13:50
@jacobheun
Copy link
Contributor Author

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 () => {
Copy link
Member

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.

Copy link
Contributor Author

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

@jacobheun
Copy link
Contributor Author

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.

@jacobheun jacobheun merged commit f75ae34 into master Oct 22, 2020
@jacobheun jacobheun deleted the fix/stream-close branch October 22, 2020 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants