News for hackers. Stuff that matters.
Re:Go 1.12 Release Candidate 1 is released by deathanatos on Tuesday February 12, 2019 @10:34AM (#19144278)
AIUI, Lambda operates on requests. (Either "calls" to a function, i.e., just invoking a lambda function w/ args and getting the result over the network somewhere else, or as an HTTP handler or a CloudWatch handler, but those are really specialized cases of the first.) Using time.NewTicker/time.After strikes me as something you would do to maintain some sort of background process, which Lambda is not intended for: IIRC, Lambda can arbitrarily freeze your process b/c no requests are being served presently, and that "capacity" isn't needed as far as AWS is concerned. I think under the hood they're doing a cgroup freezer or something, but the result would be exactly what you see: timers firing way too late. They wouldn't fire until the underlying container is unfrozen. This wouldn't be a bug in Go or Lambda; Lambda is specifically designed to do this, so as to free you from needing to care about how much capacity you require¹. (At the cost of making stuff like background timers not work; that's not its model.)

See: https://aws.amazon.com/blogs/compute/container-reuse-in-lamb...

¹ish. take that statement w/ a grain of salt.

Re:Go 1.12 Release Candidate 1 is released by freecodyx on Tuesday February 12, 2019 @11:14AM (#19144712)
Well, this is the issue, when my function exceeds the timeout configured in the function yml, lambda will respond with internal server error, and will freeze the VM, if it decides to reuse the VM for another request, then the go-routines of the last call will resume (because i didn't call os.Exit).
Re:Go 1.12 Release Candidate 1 is released by sten on Tuesday February 12, 2019 @03:41PM (#19147291)
This sounds like an amazing pain in the ass. I wonder if this impacts my own lambdas.
Re:Go 1.12 Release Candidate 1 is released by freecodyx on Tuesday February 12, 2019 @06:30PM (#19148804)
please do, and let us know