Skip to content

Wake receipt-ordered condition groups when timeout timers fire - #1386

Merged
rmcdaniel merged 1 commit into
mainfrom
general/server-1377-receipt-condition-timeout
Nov 27, 2026
Merged

rmcdaniel merged 1 commit into
mainfrom
general/server-1377-receipt-condition-timeout

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Fixes #1377.

Root cause

In Store::fire_due_timers, firing a condition_timeout timer for a receipt-ordered condition wait (condition_wait_input_order = "durable_receipt_order") previously passed successful = !evaluates_receipt_prefix (false) to Store::selection_resume. After #1383 (settle policy), selection_resume runs all_groups_closed for false as well when any enclosing frame uses settle. Because a receipt-ordered condition wait remains open until the worker evaluates the receipt prefix and sends resolve_condition_wait, all_groups_closed returned false and suppressed the wakeup, stranding the group.

What changes

  • Extract Store::coalesce_group_resume and add Store::selection_resume_now in rust/src/runtime/selections.rs to wake a parallel group immediately (still coalescing into an existing ready workflow task) without applying the group-closure barrier.
  • Call Store::selection_resume_now from Store::fire_due_timers in rust/src/runtime/store.rs when evaluates_receipt_prefix is true, and Store::selection_resume(..., true) otherwise.
  • Add grouped_condition_waits::a_receipt_ordered_condition_group_wakes_when_its_timeout_timers_fire covering legacy, propagate, and settle parallel condition groups end to end through resolve_condition_wait and ConditionWaitTimedOut.

Verification

  • Local SQLite: cargo test --test execution -- grouped_condition_waits parallel_group_policies occurrence_deadlines selections — 53 passed, 0 failed.
  • CI runs the full SQLite, MySQL 8.0, MariaDB 10.11, and PostgreSQL matrices.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Independent review: PASS at head 41b2297

  • Root cause & fix (rust/src/runtime/selections.rs, rust/src/runtime/store.rs):
    • Store::fire_due_timers previously overloaded successful = !evaluates_receipt_prefix when calling Store::selection_resume. Under Admit settle parallel groups and wake once every member has an outcome #1383 (settle), selection_resume runs all_groups_closed even when successful == false, suppressing the wakeup while the receipt-ordered condition wait or its siblings are still open.
    • Extracting Store::coalesce_group_resume and adding Store::selection_resume_now cleanly separates "wake now to evaluate an ordered-input boundary" from failure-driven wakes, bypassing all_groups_closed for legacy, propagate, settle, and nested groups while preserving ready-task coalescing (and not coalescing into leased tasks).
    • Non-receipt-ordered condition timeouts, signal timeouts, and plain timers continue to call Store::selection_resume(..., true) with unchanged semantics.
  • Edge cases checked:
    • Selection groups, standalone receipt-ordered condition waits, mixed/nested settle groups, zero-second occurrence timeouts (anchor = Some(...), inline = false), and reopened/repeated waits.
  • Test coverage (rust/tests/execution/grouped_condition_waits.rs):
    • a_receipt_ordered_condition_group_wakes_when_its_timeout_timers_fire exercises legacy (None), propagate, and settle groups end to end through resolve_condition_wait and ConditionWaitTimedOut.

@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel
rmcdaniel added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit de1a105 Nov 27, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Receipt-ordered condition group never wakes after its timeout timers fire

1 participant