Lambda allows 10s for functions to initialize.
Previously when the runtime or sandbox crashed, function timed out, or ran out of memory - it would reinitialize causing a mini cold start. This still happens, but now the re-initialization is limited to the function timeout.
If you have a Lambda function with a very short timeout and it crashes, it may never be able to re-initialize.
- Deploy with
cdk deploy - Curl the output url
- Add
<url>?crash=trueto the end of the url - Curl the output url again without
?crash=true
Result: The function will never successfully re-initialize.