Sitelet https://web.archive.org/web/20220423211107/https://github.com/nodejs/node/pull/36563
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

stream: fix pipe deadlock when starting with needDrain #36563

Closed
wants to merge 4 commits into from

Conversation

Copy link
Member

@ronag ronag commented Dec 18, 2020 •

Related Issues

Fixes: #36544

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@ronag ronag added dont-land-on-v10.x dont-land-on-v12.x dont-land-on-v14.x labels Dec 18, 2020
@ronag
Copy link
Member Author

@ronag ronag commented Dec 18, 2020

Missing test

@HomerSp
Copy link

@HomerSp HomerSp commented Dec 18, 2020

I've updated your test slightly to check for the deadlock: https://gist.github.com/bea83eb0dcbd0aea3b2689c2cd91bb38
Now it will check for the initial pause, which will happen without the fix, and also for end, which won't happen without it. I also set highWaterMark to 1 so it'll happen immediately.

@HomerSp
Copy link

@HomerSp HomerSp commented Dec 18, 2020

Seems like we may need to use common.mustCallAtLeast(1) instead of common.mustCall() because the latter requires it to be called exactly once, and it looks like the build system calls pause twice.

@ronag ronag requested a review from mcollina Dec 18, 2020
@ronag ronag added the request-ci label Dec 18, 2020
@ronag
Copy link
Member Author

@ronag ronag commented Dec 18, 2020

@ronag
Copy link
Member Author

@ronag ronag commented Dec 18, 2020

and it looks like the build system calls pause twice.

This was also a separate bug.

@ronag ronag requested a review from lpinca Dec 18, 2020
@github-actions github-actions bot removed the request-ci label Dec 18, 2020
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Dec 18, 2020

@ronag ronag added the request-ci label Dec 18, 2020
@github-actions github-actions bot removed the request-ci label Dec 18, 2020
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Dec 18, 2020

Copy link
Member

@mcollina mcollina left a comment

lgtm

@ronag ronag added the author ready label Dec 18, 2020
@HomerSp
Copy link

@HomerSp HomerSp commented Dec 19, 2020

and it looks like the build system calls pause twice.

This was also a separate bug.

It's because pause is called when it's finishing (in unpipe) as well as in the pipe call - so your latest test code looks good to me.

@ronag
Copy link
Member Author

@ronag ronag commented Dec 20, 2020

Landed in ab895bd

@ronag ronag closed this Dec 20, 2020
ronag added a commit that referenced this issue Dec 20, 2020
Fixes: #36544

PR-URL: #36563
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@ronag ronag removed the dont-land-on-v14.x label Dec 20, 2020
@ronag ronag mentioned this pull request Dec 20, 2020
4 tasks
targos pushed a commit that referenced this issue Dec 21, 2020
Fixes: #36544

PR-URL: #36563
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this issue May 1, 2021
Fixes: #36544

PR-URL: #36563
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@danielleadams danielleadams mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready dont-land-on-v12.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants