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

[RFC] handle runtime shutdowns while tasks are being spawned #80

Conversation

sunshowers
Copy link

If a runtime has been marked as shutting down before spawn_blocking is
called, or before the blocking task is first scheduled, the JoinHandle will
return a cancellation error. Currently, this panics, which tends to manifest as
test failures.

Instead, add a RunError wrapper that captures the cancellation situation.
Callers might choose to bubble this error up or to squelch it -- unfortunately,
we can't make this decision.

I haven't written tests yet but I should be able to if this looks reasonble.

The API surface here is really unfortunate, but I can't see a better way to do
this than to propagate errors up the stack.

Created using spr 1.3.6-beta.1
@sunshowers
Copy link
Author

oh my god what's wrong with you spr.

@sunshowers sunshowers closed this Oct 15, 2024
@sunshowers sunshowers deleted the sunshowers/spr/rfc-handle-runtime-shutdowns-while-tasks-are-being-spawned-2 branch October 15, 2024 03:05
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.

1 participant