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: broken assertion #100

Merged
merged 1 commit into from
May 11, 2020
Merged

fix: broken assertion #100

merged 1 commit into from
May 11, 2020

Conversation

ronag
Copy link
Member

@ronag ronag commented May 11, 2020

finished will be invoked on 'end' while destroy(err) will be delayed.
This can break the assertion in theory on edge cases.

@ronag
Copy link
Member Author

ronag commented May 11, 2020

Haven't been able to trigger this in practice, but in theory it was a problem.

finished will be invoked on 'end' while destroy(err) will be delayed.
This can break the assertion in theory on edge cases.
@@ -197,10 +197,10 @@ function _connect (client) {
client[kQueue].pause()

client[kStream].finished(socket, (err) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual behavior of how and when this is invoked, with or without error is a slightly dependent on node/readable-stream version. This is a safer way to implement.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ronag ronag merged commit 727febc into nodejs:master May 11, 2020
@ronag ronag deleted the fix-assertion branch May 11, 2020 14:42
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