I'm using two lambda functions with Javascript's 4.3 runtime. I run the first and it calls the second synchronously (sync is the intent). Problem is the second one times out (at 60sec) but it actually reaches a successful finish after only 22 seconds.
Here's the flow between the two Lambda functions:
Lamda function A I am no longer getting CloudWatch logs for but the real problem (I think) is function B which times out for no reason.
Here's some CloudWatch logs to illustrate this:
The code in Function B at the end -- which includes the "Success" log statement see in picture above -- is included below:
Originally I only had the callback(null, 'successful ...') line and not the nodejs 0.10.x way where you called succeed() off of context. In desperation I added both but the result is the same.
Anyone have an idea what's going on? Any way in which I can debug this?
In case the invocation logic between A and B makes a difference in the state that B starts in, here's the invocation:




context.callbackWaitsForEmptyEventLoop = false;may be a workaround for what you are seeing, if it's similar to what I ran into -- I had a mysql connection I wasn't disconnecting, which in turn kept the event loop non-empty. Setting the value as shown proved the problem (by "fixing" the run-until-timeout); given that evidence, I was able to solve it correctly by closing that connection, at which point I no longer needed the workaround. - Michael - sqlbot