Skip to content

fix(executor): make wait a completion barrier - #148

Merged
LimiNode merged 5 commits into
mainfrom
fix/task-executor-wait-regression
Sep 22, 2026
Merged

LimiNode merged 5 commits into
mainfrom
fix/task-executor-wait-regression

Conversation

@LimiNode

@LimiNode LimiNode commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • close the MPSC TaskExecutor::wait() race with completion tickets reserved before publication
  • make resize idle detection use the same completion protocol
  • add blocked-task, nested-submission, and repeated MPSC producer regression coverage
  • document the completion barrier contract

Validation

  • Windows MSVC MPSC build: 61/61 tests passed
  • focused wait-barrier test: passed with MPSC and non-MPSC configurations
  • focused wait-barrier test repeated five times

This is intentionally separate from the merged gzip/benchmark PR #147.

Track MPSC submissions before publication and complete each ticket when the task runs or is rejected. Make wait and resize drain against the completion protocol, and add blocked-task, nested-submission, and stress regressions for the documented wait contract.
Use atomic submission and completion counters so the MPSC producer path does not acquire a new mutex. Keep the wait condition variable only for blocking callers while preserving the completion barrier.
Update the completion state while holding the wait mutex before notifying condition-variable waiters. This prevents a lost wake-up while keeping the MPSC submission path free of locks.
Give the TaskExecutor wait regression a bounded CTest timeout so a future completion protocol regression fails the suite instead of hanging CI indefinitely.
Describe TaskExecutor::wait as a moving completion frontier that includes nested submissions before the barrier closes and may be delayed by continuous producers. Record the MPSC completion race fix in the Unreleased changelog.
@LimiNode
LimiNode merged commit 04d9ab9 into main Sep 22, 2026
16 checks passed
@LimiNode
LimiNode deleted the fix/task-executor-wait-regression branch September 22, 2026 22:27
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