-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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: gracefully close unused workers #30512
fix: gracefully close unused workers #30512
Conversation
This patch fixes issue microsoft#30504 by gracefully terminating the worker before exiting the process
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"27476 passed, 672 skipped Merge workflow run. |
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.
Thank you for the PR! Unfortunately, we cannot remove the process.exit()
call after some timeout, because graceful termination may misbehave and leave zombie processes.
There should be a different fix for this, most likely the one that waits for graceful termination in the regular worker shutdown from the dispatcher. However, I'll have to experiment with it first to figure out the right fix. We'll look into this for the v1.45 release.
Investigation notes:
I'm a little stuck with this investigation, as I can't really figure out how exactly the worker-scoped fixtures are registered. |
@NoamGaash I spent some time on the issue, and the fix is not that straightforward. Therefore, I went ahead and prepared a PR myself - #30769. Thank you for the PR and investigation! |
@dgozman Thank you so very much! It was a real blocker, and I'm so glad for your help over here. Also - it's a great learning opportunity. Do you mind if I'll ask a little to get a better understanding? I'm sure I'll have future opportunities to contribute, and it's inspiring to see the clean code and architecture. As you said yourself, graceful termination may leave zombie processes, therefore I thought the right approach to solve this issue would be investigating why it's called in the first place. The root cause for calling the worker termination was the It seems like Thanks again, both for responding and solving this issue so quickly and for Playwright as whole 😺 |
@NoamGaash There is a difference between normal operation worker stop, and the case where something went wrong. So my change assumes that during normal worker stop, triggered by |
I see. Thanks for this clarification! |
This patch suggest a fixing issue #30504 by gracefully terminating the worker before exiting the process