Skip to content

fix(jobs): prevent lost wakeups during worker shutdown - #34

Merged
Machillka merged 1 commit into
mainfrom
fix
Aug 23, 2026
Merged

fix(jobs): prevent lost wakeups during worker shutdown#34
Machillka merged 1 commit into
mainfrom
fix

Conversation

@Machillka

@Machillka Machillka commented Aug 23, 2026

Copy link
Copy Markdown
Owner
  • synchronize stop and ready predicates with the worker wake mutex
  • add idle-worker and shutdown lifecycle regression tests
  • add bounded watchdog diagnostics and repeatable test cases
  • document root cause and Debug/Release/TSan verification

Summary by CodeRabbit

  • Bug Fixes

    • Improved job scheduling reliability during shutdown, cancellation, and worker wake-up scenarios.
    • Reduced the risk of hangs when submitting work while the system is stopping.
    • Improved handling of failed initialization and orderly task draining.
  • Tests

    • Added coverage for idle-worker wake-ups, shutdown races, cancellation, and task draining.
    • Added timeout protection and focused test execution options.
  • Documentation

    • Added correctness audit results, reproduction details, and verification findings.

- synchronize stop and ready predicates with the worker wake mutex
- add idle-worker and shutdown lifecycle regression tests
- add bounded watchdog diagnostics and repeatable test cases
- document root cause and Debug/Release/TSan verification
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 421427a4-d1f3-460f-b698-8aabc64c0d5b

📥 Commits

Reviewing files that changed from the base of the PR and between 2d5fd04 and 27c0363.

📒 Files selected for processing (12)
  • .gitignore
  • .vscode/extensions.json
  • .vscode/launch.json
  • .vscode/settings.json
  • .vscode/task.json
  • .vscode/tasks.json
  • docs/develop.md
  • docs/jobs/dev/steps/2.5-job-wait-shutdown.future.md
  • docs/jobs/result/README.md
  • engine/Runtime/Jobs/src/JobSystem.cpp
  • tests/CMakeLists.txt
  • tests/unit/JobSystemTests.cpp

📝 Walkthrough

Walkthrough

The change updates VS Code build, debug, and test workflows. It also fixes JobSystem wake-state publication, adds shutdown and idle-worker regression tests, and documents the audit and validation results.

Changes

VS Code workspace tooling

Layer / File(s) Summary
VS Code build, debug, and test workflow
.gitignore, .vscode/*
The workspace adds LLDB launch profiles, CMake/Ninja settings, extension recommendations, target build tasks, and focused or complete CTest tasks.

JobSystem wake and shutdown correctness

Layer / File(s) Summary
Wake-state synchronization
engine/Runtime/Jobs/src/JobSystem.cpp
Initialization cleanup, shutdown, and ready-worker publication now update predicates under m_wakeMutex before notification.
Shutdown and idle-worker regression coverage
tests/unit/JobSystemTests.cpp, tests/CMakeLists.txt
Tests now cover idle-worker wakeups, cancellation, draining, shutdown submission races, watchdog timeouts, repeated execution, and focused CTest registration.
Correctness audit records
docs/develop.md, docs/jobs/dev/steps/2.5-job-wait-shutdown.future.md, docs/jobs/result/README.md
Documentation records the synchronization fix, reproduction evidence, test results, validation runs, and remaining platform verification work.

Estimated code review effort: 3 (Moderate) | ~25 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Machillka
Machillka merged commit 12cd631 into main Aug 23, 2026
3 of 4 checks passed
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.

1 participant