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

Remove potential for panics from spawn APIs #17974

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

stuhood
Copy link
Sponsor Member

@stuhood stuhood commented Jan 11, 2023

To resolve #16105, we will likely want to replace the global static Executor with Executors that are created per-Scheduler. That would introduce shutdown race conditions which given our current unwrap'ing in task_executor could lead to panics.

This change adjusts task_executor's spawn APIs to avoid panicing by converting task errors into the expected error/result type at each callsite.

@stuhood stuhood added the category:internal CI, fixes for not-yet-released features, etc. label Jan 11, 2023
@stuhood

This comment was marked as outdated.

…l make race conditions around Scheduler shutdown safe.
@stuhood stuhood enabled auto-merge (squash) January 12, 2023 01:02
@stuhood stuhood merged commit a97f9c2 into pantsbuild:main Jan 13, 2023
@stuhood stuhood deleted the stuhood/spawn-no-panic branch January 13, 2023 20:43
jsirois added a commit to jsirois/pants that referenced this pull request Jan 16, 2023
jsirois added a commit to jsirois/pants that referenced this pull request Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@rules which use blocking calls may not exit before the main thread with --no-pantsd
2 participants