Skip to content

Parallel-group contract and embedded Workflow disagree on same-millisecond all() failure ties #415

Open

Description

@rmcdaniel

Found while reviewing durable-workflow/sdk-python#348 (for sdk-python#307).

Problem. The parallel-group contract and embedded Workflow choose different failures when two all() members fail in the same millisecond.

  • Contract: conformance/parallel-groups/README.md (main b3e7906, line 121) says: "First-failure ties follow durable event order, never member position or a sort of timestamps." Line 103 says propagate raises the first member failure in durable history order.
  • Embedded Workflow: src/V2/Support/ParallelFailureSelector.php (workflow main 67e8a969) picks the earliest recorded_at in milliseconds. On equal milliseconds it picks the lower leaf index. WorkflowExecutor passes recorded_at?->getTimestampMs() from the member's terminal event, or closed_at for the execution rows. The concurrency guide documents the same rule ("the earliest recorded close time ... the lower barrier leaf index wins").
  • Effect: when two members fail in the same millisecond and the higher index was recorded first, embedded raises the lower index. A binding that follows the contract raises the higher one.

Python. sdk-python#348 makes Python's default (no recorded policy) raise the first failure in durable event order for runs that record its new failure-order marker. That follows the contract. Older runs keep their recorded rule. So Python and embedded can differ on same-millisecond ties, and #348 documents this.

Decision needed (Workflow, with the contract owners). Either:

  1. embedded adopts durable event order for propagate, and for its default if the default is to match the contract; or
  2. the contract states a timestamp-then-index rule, and the bindings follow it.

My recommendation: option 1. Event order is total and append-only, and it does not depend on clock resolution.

Embedded's existing absent-policy histories must keep their current selection on replay whichever option is chosen.

Acceptance

  • The contract and embedded agree on tie order for propagate, with a fixture of a same-millisecond tie.
  • The default all() rule for each runtime is documented, including any tie difference that remains for absent-policy histories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:cross-repositoryWork spans more than one public repositorypriority:P2Normal-priority product workrepo:sdk-pythonOwned by the Python SDK repositoryrepo:workflowOwned by the Workflow engine repository

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions