You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we don't run the finalizer for the Resource acquired at the Lambda's startup, which is probably okay in many instances but not ideal. Knowing when to run this finalizer is difficult without some notification/callback from the Lambda environment, and also being explicitly granted some time/backpressure to complete such finalization.
There does seem to be a Lambda Extensions API that supports a shutdown hook, but it's not obvious to me how that would help us inside the actual Lambda.
Shutdown: This phase is triggered if the Lambda function does not receive any invocations for a period of time. In the Shutdown phase, Lambda shuts down the runtime, alerts the extensions to let them stop cleanly, and then removes the environment. Lambda sends a Shutdown event to each extension, which tells the extension that the environment is about to be shut down.
I also recall someone mentioning that running these finalizers can be time-consuming (i.e. expensive) and doesn't make sense in many cases. So, something to chew on.
The text was updated successfully, but these errors were encountered:
Spinning @bpholt's comment out of #134 (comment).
Currently, we don't run the finalizer for the
Resource
acquired at the Lambda's startup, which is probably okay in many instances but not ideal. Knowing when to run this finalizer is difficult without some notification/callback from the Lambda environment, and also being explicitly granted some time/backpressure to complete such finalization.There does seem to be a Lambda Extensions API that supports a shutdown hook, but it's not obvious to me how that would help us inside the actual Lambda.
https://docs.aws.amazon.com/lambda/latest/dg/runtimes-extensions-api.html
I also recall someone mentioning that running these finalizers can be time-consuming (i.e. expensive) and doesn't make sense in many cases. So, something to chew on.
The text was updated successfully, but these errors were encountered: