Home > database >  When a state of a step function times out, does the lambda execution correlated to it continue to be
When a state of a step function times out, does the lambda execution correlated to it continue to be

Time:06-25

I want to know if a lambda execution continues to be performed even if the state of the step function correlated to it times out. If it happens, how can i stop it?

CodePudding user response:

There is no way to kill a running lambda. However, you can set concurrency limit to 0 to stop it from starting further executions

CodePudding user response:

Standard StepFunctions have a max timeout of 1 year. (yes! One year)

As such any individual task also has a max timeout of 1 year.

(Express StepFunctions have a timeout of 30 seconds mind you)

Lambda's have a max time out of 15 mins.

If you need your lambda to complete in a certain amount of time, you are best served by setting your lambda timeout to that - not your state machine. (i see in your comments you say you cannot pass a value for this? If you cannot change it then you have no choice but to let it run its course)

Consider StepFunctions and state machines to be orchestrators, but they have very little control over the individual components. They tell who to act and when but otherwise are stuck waiting on those components to reply before continuing.

If your lambda times out, it will cause your StateMachine to fail that task as as it receives a lambda service error. You can then handle that in the StepFunction without failing the entire process, see:

https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html

You could specifically use: TimeoutSecondsPath in your definition to set a specific result if the task timesout.

But as stated, no, once a lambda begins execution it will continue until it finishes or it times out at 15 mins / its set timeout.

  • Related