fix(dev): avoid mutex deadlock caused by inconsistent lock order#8370
Merged
graphite-app[bot] merged 1 commit intomainfrom Feb 19, 2026
Conversation
Member
Author
How to use the Graphite Merge QueueAdd the label graphite: merge-when-ready to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
✅ Deploy Preview for rolldown-rs canceled.
|
6e9caf0 to
8dc5a71
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical deadlock issue in the rolldown dev server caused by inconsistent lock ordering between the bundler mutex and clients concurrent map. The fix ensures all code paths follow a consistent bundler → clients lock order.
Changes:
- Moved
bundler.lock()acquisition to occur before accessingclientsin two methods - Established consistent lock ordering throughout the codebase to prevent circular wait conditions
Contributor
Benchmarks Rust
|
8dc5a71 to
23afd7b
Compare
hyf0
approved these changes
Feb 18, 2026
Member
Author
Merge activity
|
The lock order of `bundler` and `clients` were inconsistent. This potentially causes deadlocks (e.g. when one thread locks `bundler` and another thread locks `clients`). - `bundler` -> `clients` - https://github.com/rolldown/rolldown/blob/11424ab221410a0661f473795695a1ed3084528f/crates/rolldown_dev/src/bundling_task.rs#L128-L138 - `clients` -> `bundler` - https://github.com/rolldown/rolldown/blob/11424ab221410a0661f473795695a1ed3084528f/crates/rolldown_dev/src/dev_engine.rs#L269-L270 - https://github.com/rolldown/rolldown/blob/11424ab221410a0661f473795695a1ed3084528f/crates/rolldown_dev/src/dev_engine.rs#L310-L317 This PR changes all to `bundler` -> `clients`.
23afd7b to
fc69283
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The lock order of
bundlerandclientswere inconsistent. This potentially causes deadlocks (e.g. when one thread locksbundlerand another thread locksclients).bundler->clientsrolldown/crates/rolldown_dev/src/bundling_task.rs
Lines 128 to 138 in 11424ab
clients->bundlerrolldown/crates/rolldown_dev/src/dev_engine.rs
Lines 269 to 270 in 11424ab
rolldown/crates/rolldown_dev/src/dev_engine.rs
Lines 310 to 317 in 11424ab
This PR changes all to
bundler->clients.