What's going on behind the scenes when an AWS lambda function freezes?
That is -- many of the Lambda Runtime Docs refer broadly to the concept of a function freezing or unfreezing
The runtime and each extension indicate completion by sending a Next API request. Lambda freezes the execution environment when the runtime and each extension have completed and there are no pending events.
My understanding of this is that after a Lambda function initializes (or "cold starts") and executes the first invocation request, if there are no other invocations to process the function's execution environment will "freeze". Then, when there's another function invocation to process, the function's execution environment will "unfreeze" almost instantly without needing to initialize/cold-start again. If a frozen function goes too long without being invoked it will shutdown, and the next invocation request will need to cold start.
Does anyone know what this freezing is? It's my understanding that these execution environments are firecracker virtual machines. Is this freezing something that firecracker supports, or is it some extra magic that AWS Web Services has that they keep to themselves? Put another way, if I have a Firecracker VM running can I freeze and unfreeze it?