Bug: Handeling idempotency for Lambda timeout - in progress idempotency not preventing duplicate records
Maintainer thường phản hồi trong vòng 1 ngày
@leandrodamascena đang làm issue này rồi.
Từ ngày 2/4/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 3.3k
- Fork
- 511
- Merge trung bình
- 3 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 92
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws-powertools/powertools-lambda-python
-
Bug: POWERTOOLS_IDEMPOTENCY_DISABLED set to an empty or non-boolean value crashes every invocationCó thể đã có người làm @lechakrawarthy đã nhận 1 ngày trước. Đang mởbug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
aws-powertools/powertools-lambda-python#8728 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: Redis layer fails the invocation instead of retrying when a record expires between SET NX and GETCó thể đã có người làm @coughlmao đã nhận 1 ngày trước. Đang mởbug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
aws-powertools/powertools-lambda-python#8727 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: Redis orphan lock timeout ignores expires_after_seconds and is always 10 secondsCó thể đã có người làm @CJstate đã nhận 1 ngày trước. Đang mởbug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
aws-powertools/powertools-lambda-python#8726 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: idempotency payloads with set, frozenset or bytes fields cannot be hashedCó thể đã có người làm @Neeraj111010 đã nhận 1 ngày trước. Đang mởbug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
aws-powertools/powertools-lambda-python#8725 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: with a DynamoDB composite key, DataRecord.idempotency_key is the static partition key valueCó thể đã có người làm @sumedh-aerram đã nhận 1 ngày trước. Đang mởbug good first issue help wanted idempotency
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
aws-powertools/powertools-lambda-python#8724 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aws-powertools/powertools-lambda-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Nixtla/mlforecast#823 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
microsoft/ML-For-Beginners#1061 ·
-
bot-found documentation priority: P3
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 82/100
madenvel/KalinkaPlayer#503 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
EleutherAI/lm-evaluation-harness#4508 ·
Maintainer thường phản hồi trong vòng 1 ngày