My AWS Lambda occasionally fails receiving event message from Monday.com. I'm using a containerized Lambda deployment (via Docker). The flow is:
31 Mar 2022 20:51:03,614 [ERROR] (rapid) Failed to reserve: AlreadyReserved
Here's bigger log:
2022-03-31 20:51:01.587 | Info | Functions.Post:: MONDAY 'item created' REQUEST
-
2022-03-31 20:51:01 | Info | Functions.SendCreateCommandAsync()
-
2022-03-31 20:51:01 | Info | Functions.SendCreateCommandAsync() Sending command :: {"PulseId":2452591832,"AssetName":null,"AssetType":"Webinar","CreatedDate":"2022-03-31T20:51:01.427Z"}
START RequestId: 8a5fa4f7-dacb-49ba-a9ac-4aa4f0797643 Version: $LATEST
31 Mar 2022 20:51:03,614 [ERROR] (rapid) Failed to reserve: AlreadyReserved
END RequestId: a2992224-4cfc-4938-bed7-3d9120ec770e
REPORT RequestId: a2992224-4cfc-4938-bed7-3d9120ec770e Duration: 2061.62 ms Billed Duration: 2062 ms Memory Size: 3008 MB Max Memory Used: 3008 MB
START RequestId: 1dfda2a7-e0ec-44a3-9770-ba1e80221197 Version: $LATEST
-
Seems like the two events are fired to close to each other and the 2nd one cannot get through. How do I mitigate it?
This error [ERROR] (rapid) Failed to reserve: AlreadyReserved
occurs when you try to invoke AWS Lambda function running in the container image while another request is processed. To be more precise it is thrown by the AWS Lambda Runtime Interface Emulator (RIE), which is included all base AWS Lambda images and makes possible to invoke your Lambda function packaged as a container image.
Unfortunately, you won't be able to execute multiple requests in parallel locally.