Fix broken pipe when shutting down due to daemon threads #3031
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes WB-NNNN
Fixes #NNNN
Description
This can happen with this sequence of events with wandb service:
Note there is no explicit finish call.
with wandb service this gets handled by shutting down the internal process in the atexit handler.
The atexit handler has no clean way to shutdown the daemon threads in the user process. In the above case
it could shut them down -- but we dont, so we keep the atexit as simple as possible. The cases where it would
not be possible to shutdown the threads is if the above wandb.init() and no finish was called from a child process.
Testing
Not really tested for this PR.. Will run in the regression and see if it fails again. This was seen at least a few times in the ~160 tests run in the regression.
Checklist