Skip to content

syn2mas: panic in writer tasks can lead to stalling #3894

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
reivilibre opened this issue Jan 27, 2025 · 1 comment
Open

syn2mas: panic in writer tasks can lead to stalling #3894

reivilibre opened this issue Jan 27, 2025 · 1 comment
Assignees

Comments

@reivilibre
Copy link
Contributor

If a syn2mas MAS writer task panics, it doesn't shut down properly, but depending on the exact failure:

  • if all tasks panic, I suspect it will generally get stuck waiting for them to be ready to accept new tasks
  • if not all of them panic, it will be detected that some panicked — at the end

Originally posted by @reivilibre in #3878 (comment)

@reivilibre reivilibre self-assigned this Jan 27, 2025
@sandhose
Copy link
Member

One neat way to solve this is to use a tokio_util::sync::CancellationToken with a DropGuard.

If you put that guard in each task, when the task crashes, it cancels the token, and in other places you can regularly checked if the token ::is_cancelled(). This is useful as well to implement graceful shutdowns on SIGINTs & co.

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

No branches or pull requests

2 participants