Skip to content

Ensure monitorProcessTermination is ALWAYS called after body runs #90

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakepetroules
Copy link
Contributor

This fixes a regression introduced by #88. We need to ensure monitorProcessTermination is ALWAYS called after body runs, regardless of whether it threw an error or not.

Closes #89

This fixes a regression introduced by #88. We need to ensure monitorProcessTermination is ALWAYS called after body runs, regardless of whether it threw an error or not.

Closes #89
@jakepetroules jakepetroules force-pushed the eng/PR-always-monitor branch from b66271c to 59caa66 Compare June 25, 2025 00:12
@@ -779,15 +788,15 @@ internal func withAsyncTaskCleanupHandler<Result>(
// so _immediately_ if the failure scenario is due to parent task
// cancellation. We do so in a detached Task to prevent cancellation
// of the parent task from interrupting enumeration of the stream itself.
await Task.detached {
await withUncancelledTask {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already had an abstraction for this

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.

Subprocess.run can hang if body throws
1 participant