Skip to content

Conversation

@rphmeier
Copy link
Contributor

@rphmeier rphmeier commented Jun 4, 2025

Rollback delta workers each require 2 paired tasks ("run" and "completions") to run on a threadpool which has only 2 threads. Both tasks must be run to prevent deadlock.

When there were multiple sessions (>2), it was possible for the threadpool to fill up and stall such that there were only unpaired "run" and "completions" tasks, which would then never finished.

My fix here is to rewrite the code so we don't need a second task, but run it all on one task.
I also force them to join when dropped.

Still, the behavior isn't ideal when there are many threads running sessions concurrently. I'd recommend increasing the thread-pool size. This shouldn't lead to deadlocks, but maybe suboptimal performance or weird scheduling artifacts.

Copy link
Contributor Author

rphmeier commented Jun 4, 2025

Copy link
Contributor Author

rphmeier commented Jun 4, 2025

Merge activity

  • Jun 4, 11:55 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 4, 11:58 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 5, 12:00 AM UTC: @rphmeier merged this pull request with Graphite.

@rphmeier rphmeier changed the base branch from rh-fix-begin-session-deadlock-1 to graphite-base/913 June 4, 2025 23:56
@rphmeier rphmeier changed the base branch from graphite-base/913 to master June 4, 2025 23:57
@rphmeier rphmeier force-pushed the rh-fix-rollback-deadlock-2 branch from cdf44a5 to ba320a5 Compare June 4, 2025 23:58
@rphmeier rphmeier merged commit 7f6db11 into master Jun 5, 2025
8 checks passed
@rphmeier rphmeier deleted the rh-fix-rollback-deadlock-2 branch June 5, 2025 00:00
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.

2 participants