[Bug]: Emulator retries invalid invocation outputs that the service fails immediately
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 72/100
Línea de trabajo
Comienza en aws_durable_execution_sdk_python_testing.executor.Executor._finish_invocation() y sigue _validate_invocation_response_and_store() y _retry_invocation(). Reproduce los casos de salida no válida enumerados y el caso PENDING; después, añade cobertura de regresión que muestre el comportamiento fail-fast, la estructura del error InvalidParameterValueException, un límite de tres intentos para PENDING y la recuperación después de una salida no válida transitoria.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Expected Behavior
The emulator should mirror the service's handling of invalid invocation outputs. Verified service behavior:
Most invalid outputs fail the execution immediately, with no retry. This applies to:
Status=FAILEDwith aResultpresentStatus=SUCCEEDEDwith anErrorpresent- a missing or unrecognized
Status - an unparseable/malformed invocation output payload
In each case the service fails the execution with an error object of the form:
{
"ErrorType": "InvalidParameterValueException",
"ErrorMessage": "<the specific validation message>"
}
There is exactly one retried case: Status=PENDING when the execution has no pending operations. The service treats this as a transient runtime-level error (it can arise from SDK race conditions that resolve on replay) and retries the invocation, up to 3 consecutive attempts, before failing the execution with the same InvalidParameterValueException-shaped error.
Actual Behavior
In aws_durable_execution_sdk_python_testing.executor.Executor._finish_invocation(), all validation failures from _validate_invocation_response_and_store() are routed through the same retry path:
except (InvalidParameterValueException, IllegalStateException) as e:
...
self._set_invocation_gate(execution_arn, InvocationState.PRE_INVOKE)
self._retry_invocation(execution, error_obj)
return
_retry_invocation re-invokes the handler up to MAX_CONSECUTIVE_FAILED_ATTEMPTS = 5 times with a flat RETRY_BACKOFF_SECONDS = 5 backoff before failing.
Consequences:
- A deterministically invalid output (e.g.
SUCCEEDEDwith anError) is re-invoked 5 times before failing, where the service fails on the first response. For a deterministic handler this adds ~25 seconds and 4 pointless invocations, and every re-invocation replays the handler. - The one case the service does retry (
PENDINGwith no pending operations) gets 5 attempts instead of 3. - The terminal error surfaced to the customer is
ErrorObject.from_exception(e)rather than the service's{ErrorType: "InvalidParameterValueException", ErrorMessage: ...}shape.
Proposed Fix
In _finish_invocation, distinguish the two classes:
- Fail-fast validation errors (
FAILED+Result,SUCCEEDED+Error, missing/unknown status, malformed output): fail the execution immediately with anInvalidParameterValueException-typed error object carrying the validation message. PENDINGwith no pending operations: keep the retry path, with a consecutive-attempt cap of 3.
Regression tests:
- each fail-fast case produces a FAILED execution after a single invocation, with the
InvalidParameterValueExceptionerror shape; PENDINGwith no pending operations retries and fails after 3 consecutive attempts;- a transient case (invalid output once, then a valid
PENDING/SUCCEEDED) recovers without failing the execution.
Related
- Found while investigating https://github.com/aws/aws-durable-execution-sdk-python/issues/656 (FAILED without ErrorObject completed as SUCCEEDED by local emulator). This issue covers the adjacent divergence in the same code path: how invalid outputs are retried vs. failed.
SDK Version
aws-durable-execution-sdk-python-testing current main as of 2026-08-21.
Python Version
3.13
Is this a regression?
No known working version.
- Lenguaje dominante
- Python
- Estrellas
- 59
- Forks
- 32
- Merge medio
- 1 d 5 h
- PR fusionados (30 d)
- 76
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws/aws-durable-execution-sdk-python
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
aws/aws-durable-execution-sdk-python#977 ·
Los mantenedores suelen responder en 1 día
-
[AgentCore session] Remove the unused session timeoutPosiblemente ocupada @srivilliamsai la tomó hoy. Abiertoneeds-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
aws/aws-durable-execution-sdk-python#970 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
aws/aws-durable-execution-sdk-python#952 ·
Los mantenedores suelen responder en 1 día
-
[AgentCore session] W4: Document sessions in the worker READMEPosiblemente ocupada @ParidelPooya la tomó hace 3 días. Abiertoenhancement needs-triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 76/100
aws/aws-durable-execution-sdk-python#950 ·
Los mantenedores suelen responder en 1 día
-
[AgentCore session] W3: Add the session ID and job count to worker logsPosiblemente ocupada @ParidelPooya la tomó hace 3 días. Abiertoenhancement needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
aws/aws-durable-execution-sdk-python#949 ·
Los mantenedores suelen responder en 1 día
Todos los issues de aws/aws-durable-execution-sdk-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
Unused loot bag group names left in dreamcraft en_US.langPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. AbiertoStatus: Triage Suggestion
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
GTNewHorizons/GT-New-Horizons-Modpack#27789 ·
Los mantenedores suelen responder en 1 día
-
bug frontend sev-5
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
-
core good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
b4b code health next
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ESCOMP/CTSM#4330 · 1 comentario ·
Los mantenedores suelen responder en 1 día