简体   繁体   中英

AWS Lambda Task timed out

I have create a one function and sent mail to users but it time out

05:48:54
END RequestId: 3508fc6c-29cb-442b-95dd-c963018ca5f3

05:48:54
REPORT RequestId: 3508fc6c-29cb-442b-95dd-c963018ca5f3  Duration: 900083.68 ms  Billed Duration: 900000 ms Memory Size: 256 MB  Max Memory Used: 43 MB

05:48:54
2019-06-25T05:48:54.532Z 3508fc6c-29cb-442b-95dd-c963018ca5f3 Task timed out after 900.08 seconds

I have set TimeoutInfo 15 min.

Another potential issue might be that you have an active connection, so the aws lambda is not responding until the connection terminates.

callbackWaitsForEmptyEventLoop – Set to false to send the response right away when the callback executes, instead of waiting for the Node.js event loop to be empty. If this is false, any outstanding events continue to run during the next invocation.

If this is the case, you can set callbackWaitsForEmptyEventLoop = false to make callback response immediately by

context.callbackWaitsForEmptyEventLoop = false;

Official doc

Check what is the timeout set in configuration file Also check for VPC!

"Error handling for a given event source depends on how Lambda is invoked. Amazon CloudWatch Events is configured to invoke a Lambda function asynchronously."

"Asynchronous invocation – Asynchronous events are queued before being used to invoke the Lambda function. If AWS Lambda is unable to fully process the event, it will automatically retry the invocation twice, with delays between retries."

So the retry should happen in this case. Not sure what was wrong with your lambda function , just delete and created again and may works!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM