aws / aws/aws-durable-execution-sdk-python
[Bug]: Virtual child replay can consume a non-virtual container checkpoint
- Lingua principale
- Python
- Stelle
- 53
- Fork
- 25
- Merge medio
- 1g 19h
- PR unite (30g)
- 40
Descrizione
## 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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia da ChildOperationExecutor.check_result_status() e segui la gestione dei checkpoint terminali per i contesti child virtuali. Aggiungi la regressione unitaria richiesta e un test composto di esecuzione durevole; il lavoro è completato quando un checkpoint non virtuale viene rifiutato con NonDeterministicExecutionError prima che vengano utilizzati risultati memorizzati nella cache o hook di replay/update.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- distributed-systems
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 72/100