- Newest
- Most votes
- Most comments
One possible way this can happen is if a Lambda function is run for the first time (we call this a "cold start"); is then stopped for a while; and then is restarted when another event triggers it (a "warm start"). If the time in between the end of the cold start invocation and the warm start is high enough, DynamoDB will have terminated the TCP session that was created during the first invocation. But the Lambda function has no awareness that it was stopped at all - for it, no time passed between the end of the first invocation and the second (the warn start).
The way to prevent this is to ensure that your code re-establishes network sessions on a warm start - either by checking that the session is alive or by handling socket error messages such as this when they occur.
Thanks ! We are going to try that on our side and I'll update you if it correct something !
After months of monitoring, it seems that it solved the issue. We chased all the clients (dynamodb, eventbridge etc...) and closed them at the send of our lambda execution.
Hope it helps someone.
Relevant content
- Accepted Answerasked 3 years ago
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
Can you provide the full stack trace?