Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens to a running AWS lambda during redeployment?

Tags:

aws-lambda

What happens if I deploy new version of a lambda while the old one is running?

Is the old one interrupted? Or will the new one be used to handle the next event while the old one runs as if nothing happened?

I can't find docs about it

like image 970
Federico Fissore Avatar asked Jan 09 '18 13:01

Federico Fissore


2 Answers

I posted the same question on the AWS forums and got this reply from AWS dev

It's what you suggest: In-flight invocations complete, without code changes or interruption, using the version of the function that was in place at the time they began. You can potentially have a function change for asynchronous invocations that experience errors or throttles, because a retry will potentially allow a new version of the function to be hit on the next attempt. While we do not abort in-flight invocations, we will aggressively eliminate copies of the old code; this typically happens within a minute of a function being updated. That means that for up to about 5-6 minutes (the max duration of a function, plus a little bit) you can experience either/both versions in use; after that, you should see only the new(ly deployed) version executing.

https://forums.aws.amazon.com/thread.jspa?threadID=270926&tstart=0

like image 133
Federico Fissore Avatar answered Oct 23 '22 07:10

Federico Fissore


The previous version keeps running until it finishes. New invocations after the deployment is completed get the new Lambda version.

like image 35
Mark B Avatar answered Oct 23 '22 07:10

Mark B