⚡ Optimize blocking Git operations in GitWorker#53
Conversation
Wrapped `update_shared_state` in `tokio::task::block_in_place` to prevent blocking the async runtime during git status updates. Added `test_non_blocking_behavior` to verify the fix and prevent regression. Updated `test_git_worker_continuous_run` to use multi-threaded runtime. Fixed unrelated clippy warnings in `src/pane/advice_panel.rs` and `src/ui.rs`. Co-authored-by: myaple <10523487+myaple@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
This is failing tests |
I've investigated the potential test failures. I've updated |
Updated `test_non_blocking_behavior` to use `worker_threads = 2`. This ensures that `block_in_place` has another thread available to run concurrent tasks without relying on potentially slow thread spawning. Also removed an unused import in `src/pane/help_pane.rs`. Co-authored-by: myaple <10523487+myaple@users.noreply.github.com>
|
cargo test --release --locked --all is breaking |
I've run the tests locally with |
Wrapped `update_shared_state` in `tokio::task::block_in_place` to prevent blocking the async runtime during git status updates. Added `test_non_blocking_behavior` to verify the fix and prevent regression. Updated `test_git_worker_continuous_run` to use multi-threaded runtime. Fixed unrelated clippy warnings in `src/pane/advice_panel.rs` and `src/ui.rs`. Co-authored-by: myaple <10523487+myaple@users.noreply.github.com>
git statusupdate (self.update_shared_state()) intokio::task::block_in_place. This ensures that the heavy I/O and computation involved in checking the repository status (especially with many files) is offloaded to a blocking thread, allowing the async runtime to continue processing other tasks.git2operations directly within an async loop running on a Tokio runtime thread. This could starve other async tasks (like UI updates or network requests) and cause unresponsiveness, especially in large repositories.test_non_blocking_behaviorwhich simulates a slow git status operation (with 200 files). The test measures the scheduling latency of a concurrent monitoring task.test_git_worker_continuous_runto use#[tokio::test(flavor = "multi_thread")]to supportblock_in_place.clippywarnings (deprecatedset_cursor, manualclamp, manualstrip_prefix) to ensure a clean build.PR created automatically by Jules for task 12117290299193991373 started by @myaple