-
Notifications
You must be signed in to change notification settings - Fork 678
refactor(dev): use actor design pattern and allow to recover from intial build error #6936
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
refactor(dev): use actor design pattern and allow to recover from intial build error #6936
Conversation
How to use the Graphite Merge QueueAdd the label graphite: merge 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.
|
bcb6583 to
eee2b98
Compare
Benchmarks Rust
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the dev server to use an actor design pattern, replacing shared Mutex<BuildState> with message-passing between actors. The primary goal is to fix recovery from initial build errors and prevent potential deadlock issues.
Key Changes:
- Introduced
BundleCoordinatoractor that manages build state via message passing instead of shared locks - Added
InitialBuildStatetracking to properly handle initial build failures and retries - Replaced
BuildDriver/BuildDriverServicewith unifiedBundleCoordinatorthat handles both scheduling and execution coordination
Reviewed Changes
Copilot reviewed 21 out of 31 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
crates/rolldown/src/dev/bundle_coordinator.rs |
New coordinator actor implementing message-based build orchestration |
crates/rolldown/src/dev/types/initial_build_state.rs |
Enum tracking initial build lifecycle (InProgress/Succeeded/Failed) |
crates/rolldown/src/dev/types/coordinator_msg.rs |
Message types for coordinator communication |
crates/rolldown/src/dev/types/bundling_status.rs |
Response type for build status queries |
crates/rolldown/src/dev/types/task_input.rs |
Added InitialBuild variant for retry after initial failure |
crates/rolldown/src/dev/dev_engine.rs |
Refactored to use coordinator pattern instead of build driver |
crates/rolldown/src/dev/bundling_task.rs |
Simplified task execution without state machine transitions |
crates/rolldown/src/dev/dev_context.rs |
Removed shared state, only keeps coordinator channel reference |
crates/rolldown/tests/rolldown/topics/hmr/recover_from_intial_build_error/* |
Test case for initial build error recovery |
crates/rolldown_testing/src/integration_test.rs |
Updated to handle optional HMR callbacks for initial builds |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
crates/rolldown/tests/rolldown/topics/hmr/recover_from_intial_build_error/artifacts.snap:39
- Typo in "intial" - should be "initial". This appears in the file path.
crates/rolldown/src/dev/bundling_task.rs:178 - The error message returned here is not informative. Instead of a generic "Err" message, it should include details about what failed. Consider using the actual error from
build_resultor providing a more descriptive error message.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9411aec to
61f496a
Compare
Merge activity
|
…ial build error (#6936) Fixes the case of recovering from intial build error at #6648. - I removed `Mutex<BuildState>` to prevent potential dead lock problem. - No shared state observation, every actor maintains its own state within itself. State transition are done by messaging. - All operations are done by passing messages(will revise this decision for performance intensive scenario. - General error handling is still in investigation.
61f496a to
018d175
Compare
…ial build error (#6936) Fixes the case of recovering from intial build error at #6648. - I removed `Mutex<BuildState>` to prevent potential dead lock problem. - No shared state observation, every actor maintains its own state within itself. State transition are done by messaging. - All operations are done by passing messages(will revise this decision for performance intensive scenario. - General error handling is still in investigation.
018d175 to
9c25840
Compare
## [1.0.0-beta.50] - 2025-11-12 ### 🚀 Features - rolldown: oxc_resolver v11.13.2 (#6956) by @Boshen - rolldown: oxc v0.97.0 (#6940) by @Boshen ### 🐛 Bug Fixes - handle error when creating output chunk directories (#6953) by @sapphi-red - throw error if `experimental.hmr` is set for APIs other than `dev` (#6860) by @Copilot - apply output.paths transformation to chunk.imports and generated code (#6923) by @Copilot ### 🚜 Refactor - use `anyhow::Context::context` where applicable (#6952) by @sapphi-red - dev: use actor design pattern and allow to recover from intial build error (#6936) by @hyf0 ### 📚 Documentation - add sitemap (#6929) by @mdong1909 ### 🧪 Testing - validate publishConfig.exports matches exports field (#6950) by @Copilot - re-enable output/paths/function test (#6934) by @Copilot ### ⚙️ Miscellaneous Tasks - rename `rolldown_watcher` to `rolldown_fs_watcher` (#6958) by @hyf0 - enable trust policy (#6948) by @iiio2 - deps: update napi (#6951) by @renovate[bot] - deps: update dependency rolldown-plugin-dts to v0.17.6 (#6947) by @renovate[bot] - deps: update npm packages (#6937) by @renovate[bot] - deps: update dependency tsdown to v0.16.2 (#6933) by @renovate[bot] ### ❤️ New Contributors * @mdong1909 made their first contribution in [#6929](#6929) Co-authored-by: sapphi-red <[email protected]>
#6965) - I'm investigating #6936 (comment). I find I have to use tracing to inspect the behavior, so I turn to solve some issues related to tracing. - Previously, we use `trace` level to infer the event is a devtools-specific event, while this allows us to freely write tracing code with any level now. @IWANABETHATGUY cc
…e a rebuild task if there're no queued tasks (#6968) Fixes [edit-reload test](#6936 (comment)).

Fixes the case of recovering from intial build error at #6648.
Mutex<BuildState>to prevent potential dead lock problem.