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: gracefully close unused workers #30512

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

NoamGaash
Copy link
Contributor

This patch suggest a fixing issue #30504 by gracefully terminating the worker before exiting the process

This patch fixes issue microsoft#30504 by gracefully terminating the worker before exiting the process

This comment has been minimized.

Copy link
Contributor

Test results for "tests 1"

27476 passed, 672 skipped
✔️✔️✔️

Merge workflow run.

Copy link
Contributor

@dgozman dgozman left a 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.

@NoamGaash
Copy link
Contributor Author

NoamGaash commented May 5, 2024

Investigation notes:

  • the dispatcher calls worker.stop() because _isWorkerRedundant(worker) evaluates as true.
  • the worker is considered to be redundant because isWorkerRedundant sees that the _queuedOrRunningHashCount is zero - there are no queued or running jobs, as the worker teardown doesn't count as a job

I'm a little stuck with this investigation, as I can't really figure out how exactly the worker-scoped fixtures are registered.

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.

None yet

2 participants