Bug: Handeling idempotency for Lambda timeout - in progress idempotency not preventing duplicate records
I maintainer di solito rispondono entro 1 giorno
@leandrodamascena ci sta già lavorando.
Dal 2/4/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Expected Behaviour
I started experiencing error where if lambda timeouts during executing idempotency in-progress is ignored and allows to submit the same lambda request again.
It was implemented within this PR https://github.com/aws-powertools/powertools-lambda-python/pull/1387
After reviewing code I can not find way to override in_progress_expiry_timestamp value via configuration, because I do not want this value to be set to lambda timeout value.
I want this value to be set manually to desire duration for example 1 hour.
Current Behaviour
Lambda idempotency timeout handling was implemented within https://github.com/aws-powertools/powertools-lambda-python/pull/1387
When Lambda timeouts while idempotency is in progress this allows to submit the same payload again.
For example if we passing idempotency_key and payload to make withdrawal within 3rd party API or start step function. If Lambda timeouts while executing it, it allows to repeat this action and ignores idempotency_key.
Currently it is no setting to change field value for in_progress_expiry_timestamp
Code snippet
https://github.com/aws-powertools/powertools-lambda-python/pull/1387/changes#diff-becc2a8b1233bddbb0d38b13a8634ab96bdd5d00f16f0514f6ea1df509c3b1d6R353
if remaining_time_in_millis:
now = datetime.datetime.now()
period = datetime.timedelta(milliseconds=remaining_time_in_millis)
timestamp = (now + period).timestamp()
data_record.in_progress_expiry_timestamp = int(timestamp * 1000)
else:
warnings.warn(
"Couldn't determine the remaining time left. "
"Did you call register_lambda_context on IdempotencyConfig?"
)
Possible Solution
Allow field in_progress_expiry_timestamp value to be set via configuration.
Steps to Reproduce
- Configure idempotency for lambda
- Add lambda timeout for 10 seconds
- Invoke step function within lambda
- After invoking step function within handler add time.sleep(20) - to cause Lambda timeout
- Execute Lambda two times and observe that two executions within steps function (should be one)
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.13
Packaging format used
PyPi
Debugging logs
- Lingua principale
- Python
- Stelle
- 3.3k
- Fork
- 511
- Merge medio
- 3g 8h
- PR unite (30g)
- 92
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aws-powertools/powertools-lambda-python
-
Bug: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocationForse già presa @lechakrawarthy l’ha presa 1 giorno fa. Apertabug good first issue help wanted idempotency
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
aws-powertools/powertools-lambda-python#8728 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: Redis layer fails the invocation instead of retrying when a record expires between SET NX and GETForse già presa @coughlmao l’ha presa 1 giorno fa. Apertabug good first issue help wanted idempotency
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
aws-powertools/powertools-lambda-python#8727 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: Redis orphan lock timeout ignores expires_after_seconds and is always 10 secondsForse già presa @CJstate l’ha presa 1 giorno fa. Apertabug good first issue help wanted idempotency
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
aws-powertools/powertools-lambda-python#8726 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: idempotency payloads with set, frozenset or bytes fields cannot be hashedForse già presa @Neeraj111010 l’ha presa 1 giorno fa. Apertabug good first issue help wanted idempotency
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
aws-powertools/powertools-lambda-python#8725 · 6 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: with a DynamoDB composite key, DataRecord.idempotency_key is the static partition key valueForse già presa @sumedh-aerram l’ha presa 1 giorno fa. Apertabug good first issue help wanted idempotency
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
aws-powertools/powertools-lambda-python#8724 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di aws-powertools/powertools-lambda-python
Issue simili
-
Import errors are swallowed: PerthImplicitWatermarker silently becomes NoneForse già presa @JonRC l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
resemble-ai/Perth#23 ·
-
correction metadata
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 65/100
acl-org/acl-anthology#10753 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
earthtojake/text-to-cad#758 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 70/100
DataTalksClub/faq#545 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno