←back to thread

115 points nonfamous | 1 comments | | HN request time: 0s | source
Show context
johnduhart ◴[] No.44567380[source]
Oh wow, a 23-page write up about how the author misunderstood AWS Lambda's execution model [1].

> It emits an event, then immediately returns a response — meaning it always reports success (201), regardless of whether the downstream email handler succeeds or fails.

It should be understood that after Lambda returns a response the MicroVM is suspending, interrupting your background HTTP request. There is zero guarantee that the request would succeed.

1: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-...

replies(4): >>44567460 #>>44568625 #>>44568884 #>>44573721 #
kevin_nisbet ◴[] No.44567460[source]
I don’t know about node but a fun abuse of this is background tasks can still sometimes run on a busy lambda as the same process will unsuspend and resuspend the same process. So you can abuse this sometimes for non essential background tasks and to keep things like caches in process. You just cant rely on this since the runtime instead might just cycle out the suspended lambda.
replies(3): >>44567489 #>>44569182 #>>44578407 #
1. __turbobrew__ ◴[] No.44578407[source]
TiTiler does exactly that. Geospatial rasters are stored in S3, and the lambda retains a cache in memory of loaded data from S3. So if the same lambda execution is used it can return cached data without hitting S3.