fix: prevent deadlock in DevEngine::close() by scoping bundler lock#8569
Merged
hyf0 merged 2 commits intoperf/share-tokio-runtime-fixture-testsfrom Mar 7, 2026
Merged
fix: prevent deadlock in DevEngine::close() by scoping bundler lock#8569hyf0 merged 2 commits intoperf/share-tokio-runtime-fixture-testsfrom
hyf0 merged 2 commits intoperf/share-tokio-runtime-fixture-testsfrom
Conversation
…ent deadlock Co-authored-by: hyf0 <49502170+hyf0@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] WIP address CI hang issue and refine close logic
fix: prevent deadlock in DevEngine::close() by scoping bundler lock
Mar 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a potential deadlock in DevEngine::close() where the bundler MutexGuard was held across the coordinator_handle.await call. A bundling task spawned by the coordinator (after receiving messages queued before Close) could block indefinitely trying to acquire the same bundler lock, while the coordinator waited for that task to finish.
Changes:
- Scope the bundler lock in
DevEngine::close()so it's released before awaiting the coordinator handle - Improve the
dev_engine.close()panic message in integration tests to includetest_folder_pathfor better failure attribution
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
crates/rolldown_dev/src/dev_engine.rs |
Wraps bundler.lock()/bundler.close() in an explicit brace scope so the MutexGuard is dropped before coordinator_handle.await, eliminating the deadlock |
crates/rolldown_testing/src/integration_test.rs |
Adds test_folder_path.display() to the close-failure panic message for easier test debugging |
Contributor
Benchmarks Rust |
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.
DevEngine::close()held the bundlerMutexGuardwhile awaiting the coordinator task to exit. If the coordinator'sClosehandler was waiting for a running bundling task — which also needs the bundler lock — this deadlocked, causing CI hangs.Changes
crates/rolldown_dev/src/dev_engine.rs: Scope the bundler lock so it's dropped beforecoordinator_handle.await. The coordinator'sClosehandler may need toawaitan in-flight bundling task that contends on the same lock.crates/rolldown_testing/src/integration_test.rs: Includetest_folder_pathin the close-failure panic message so failures are attributable to a specific fixture.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.