AWS Lambda Re-starting after one minute


I have lambda which executes a TSQL from a file and returns the data (RDS MYsql) to a variable in the code. I have used python for coding. The issue is that the TSQL takes approx 3 minute to complete. When executing this TSQL the lambda tends to re-execute from beginning i.e starts again even before the handler definition after every one minute.

I have used pymysql and mysql connector and both gives the same issue. I can see that the cloudwatch log for the lambda also restarting. There are multiple executions shown in process list.

Can someone point out where I am going wrong.

Prachin Soparkar