generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 465
Labels
Description
Expected Behaviour
Idempotency utility detects it is a durable execution and invokes the handler
Current Behaviour
Raise IdemptoencyAlreadyInProgressError. Function will never terminate successfully. IdempotencyRecord in the persistance provider will be left in INPROGRESS state
Code snippet
from aws_durable_execution_sdk_python import (
DurableContext,
StepContext,
durable_execution,
durable_step,
)
from aws_durable_execution_sdk_python.config import Duration
from aws_lambda_powertools.utilities.idempotency import (
DynamoDBPersistenceLayer,
idempotent,
)
persistence_layer = DynamoDBPersistenceLayer(table_name="powertools-idempotency-table")
@durable_step
def greet_user(step_context: StepContext, name: str) -> str:
"""Generate a greeting."""
return f"Hello {name}!"
@durable_execution
@idempotent(persistence_store=persistence_layer)
def lambda_handler(event: dict, context: DurableContext) -> str:
"""Simple durable function."""
print(event, context)
name = event.get("name", "World")
greeting = context.step(greet_user(name))
context.wait(duration=Duration.from_seconds(2))
return greetingPossible Solution
No response
Steps to Reproduce
- Create lambda function with durable config specified
- Invoke handler above
- Observe error
Powertools for AWS Lambda (Python) version
latest
AWS Lambda function runtime
3.14
Packaging format used
PyPi
Debugging logs
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Working on it