I have a Python 3.6 - Flask application deployed onto AWS Lambda using Zappa, in which I have an asynchronous task execution function defined using @Task as discussed here
However, I find that the function call still times out at 30 seconds as against the 5 minute timeout that AWS Lambda enforces for non-API calls. I even checked the timeout in my Lambda settings and it is set to 5 minutes.
The way I discovered this is when the lambda's debug output started repeating without a request - something that happens because the lamba is called 2 more times because of either an error or timeout (as per the AWS Lambda documentation).
Can anyone help me with getting this resolved?
[EDIT : The lambda function is also not part of any VPC and is set to be accessible from the internet.]
Here are the logs below. Basically, the countdown is a sleep timer counting to 20 seconds, followed by a @task call to application.reviv_assign_responder, but as we see, there is no outpust past 'NEAREST RESPONDER' and the countdown starts again, indicating that the function has timed out and has been called again by (AWS') design.
Log output in Pastebin : https://pastebin.com/VEbdCALg
Second incident - https://pastebin.com/ScNhbMcn
As we can see in the second log, it clearly states:
[1515842321866] wait_one_and_notify : 30 : 26 [1515842322867] wait_one_and_notify : 30 : 27 [1515842323868] wait_one_and_notify : 30 : 28 [1515842324865] 2018-01-13T11:18:44.865Z 72a8d34a-f853-11e7-ac2f-dd12a3d35bcb Task timed out after 30.03 seconds