←back to thread

115 points nonfamous | 1 comments | | HN request time: 0s | source
Show context
ceejayoz ◴[] No.44567373[source]
I saw this come up on /r/aws a few days back.

This response seemed illuminating:

https://www.reddit.com/r/aws/comments/1lxfblk/comment/n2qww9...

> Looking at (this section)[https://will-o.co/gf4St6hrhY.png], it seems like you're trying to queue up an asyncronous task and then return a response. But when a Lambda handler returns a response, that's the end of execution. You can't return an HTTP response and then do more work after that in the same execution; it's just not a capability of the platform. This is documented behavior: "Your function runs until the handler returns a response, exits, or times out". After you return the object with the message, execution will immediately stop even if other tasks had been queued up.

replies(2): >>44567415 #>>44567675 #
mcflubbins ◴[] No.44567415[source]
If this is the case (it might very well be) I do at least find it odd that no one on AWS' side was able to explain this to them.
replies(6): >>44567446 #>>44567457 #>>44567464 #>>44567509 #>>44567669 #>>44569284 #
somethingAlex ◴[] No.44567464[source]
It may just be such a basic tenant of the platform that no one thought to. You stop getting billed after lambda returns a response so why would you expect computation to continue? This guy expected free lunch.
replies(1): >>44567701 #
charcircuit ◴[] No.44567701{3}[source]
I don't see that on the main AWS Lambda pages. It just says that you pay for what you use. It would make sense that the time billed would be until there is no more code to execute.
replies(3): >>44567740 #>>44567843 #>>44573010 #
1. somethingAlex ◴[] No.44567843{4}[source]
Fair enough, I guess this just seems like a bold assumption to make since an explicit handler function is a cornerstone of lambda, rather than being able to run module level code and having the end self detected.