aws / aws/aws-durable-execution-sdk-python

[Bug]: Virtual child replay can consume a non-virtual container checkpoint

Offen
#704 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug pkg:sdk
Vorherrschende Sprache
Python
Sterne
53
Forks
25
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
40

Beschreibung

## Expected Behavior

When replay changes a `run_in_child_context` operation from non-virtual to `ChildConfig(is_virtual=True)`, the SDK should reject the existing container checkpoint with `NonDeterministicExecutionError` before returning its cached result or emitting replay hooks.

Virtual child contexts never write their own container checkpoint. Therefore, any existing checkpoint at the virtual child operation ID proves that the prior execution used non-virtual checkpointing.

## Actual Behavior

`is_virtual` is not represented in `OperationIdentifier`. A successful `CONTEXT` checkpoint from a previous non-virtual child passes type, subtype, name, and parent validation. `ChildOperationExecutor.check_result_status()` then returns the cached result without executing the current virtual child body, so changes to the inner hierarchy are never validated.

This reproduces on both `main` and PR #698, so it is pre-existing and separate from #692, whose scope is type/subtype/name checkpoint identity.

## Suggested Fix

- Reject any existing child-container checkpoint when the current child is virtual.
- Perform the rejection before terminal checkpoint handling and replay/update plugin hooks.
- Add a unit regression for `ChildOperationExecutor` and a composed durable-execution test covering non-virtual to virtual replay.

## Context

Found while reviewing #698. Related review threads:

- #698 review comment 3909282767
- #698 review comment 3922629188

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit ChildOperationExecutor.check_result_status() und verfolge die Verarbeitung terminaler Checkpoints für virtuelle Child-Kontexte. Füge die angeforderte Unit-Regression und einen zusammengesetzten Durable-Execution-Test hinzu; abgeschlossen bedeutet, dass ein nicht virtueller Checkpoint mit NonDeterministicExecutionError abgelehnt wird, bevor gecachte Ergebnisse oder Replay-/Update-Hooks verwendet werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
distributed-systems
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
72/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.