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

Kill subprocess on main thread shutting down #3120

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

Conversation

nvidianz
Copy link
Collaborator

Description

flare API starts several thread pools but it doesn't provide a shutdown/cleanup call.
The user's code doesn't terminate if it errors out. A watch thread is added to kill the
process on shutting down.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Quick tests passed locally by running ./runtest.sh.
  • In-line docstrings updated.
  • Documentation updated.

@nvidianz
Copy link
Collaborator Author

/build

@nvidianz
Copy link
Collaborator Author

nvidianz commented Jan 7, 2025

/build

@nvidianz nvidianz requested a review from yanchengnv January 7, 2025 15:24
Copy link
Collaborator

@yanchengnv yanchengnv left a comment

Choose a reason for hiding this comment

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

Not sure about the death watcher

"""
try:
while True:
if threading._SHUTTING_DOWN:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure this is a good practice. I googled about the use of SHUTTING_DOWN, and people seem to suggest against using it.

Maybe we should just make sure that all threads set daemon to True.

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.

3 participants