Bug: Handeling idempotency for Lambda timeout - in progress idempotency not preventing duplicate records
Les mainteneurs répondent en général sous 1 jour
@leandrodamascena y travaille déjà.
Depuis le 2/4/2026.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
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
- Langage dominant
- Python
- Étoiles
- 3.3k
- Forks
- 511
- Merge moyen
- 3 j 8 h
- PR mergées (30 j)
- 92
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de aws-powertools/powertools-lambda-python
-
Bug: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocationPeut-être pris @lechakrawarthy l’a pris il y a 2 jours. Ouvertebug good first issue help wanted idempotency
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
aws-powertools/powertools-lambda-python#8728 · 4 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Bug: Redis layer fails the invocation instead of retrying when a record expires between SET NX and GETPeut-être pris @coughlmao l’a pris il y a 2 jours. Ouvertebug good first issue help wanted idempotency
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
aws-powertools/powertools-lambda-python#8727 · 4 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Bug: Redis orphan lock timeout ignores expires_after_seconds and is always 10 secondsPeut-être pris @CJstate l’a pris il y a 2 jours. Ouvertebug good first issue help wanted idempotency
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
aws-powertools/powertools-lambda-python#8726 · 3 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Bug: idempotency payloads with set, frozenset or bytes fields cannot be hashedPeut-être pris @Neeraj111010 l’a pris il y a 2 jours. Ouvertebug good first issue help wanted idempotency
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
aws-powertools/powertools-lambda-python#8725 · 6 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Bug: with a DynamoDB composite key, DataRecord.idempotency_key is the static partition key valuePeut-être pris @sumedh-aerram l’a pris il y a 2 jours. Ouvertebug good first issue help wanted idempotency
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
aws-powertools/powertools-lambda-python#8724 · 3 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de aws-powertools/powertools-lambda-python
Issues similaires
-
ci-rerun: collect.py fails a whole pr-babysit cycle on one transient GitHub 5xx and never retriesOuvertefollow-up
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Built-in QUBO fallback applies bitwise xor to floating binary statesPeut-être pris @iloveeyjafjalla l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
qboson/kaiwu-pytorch-plugin#1702 ·
Les mainteneurs répondent en général sous 3 jours
-
bug v2
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
modelcontextprotocol/python-sdk#3811 ·
Les mainteneurs répondent en général sous 1 jour
-
cost:cheap practicality:seen-in-the-wild severity:medium
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
Les mainteneurs répondent en général sous 1 jour