Closed drewsb closed 4 years ago
Hi @drewsb,
Thanks for posting the issue.
Few things to check out for:
I see the reference to _dataService in the above code. Could you please share on how this is initialized and if something in the code is causing the connection to RDS to be closed?
Does your Lambda function has appropriate policies in place to access RDS service?
Thanks, Ashish
Hi @ashishdhingra, I realized the issue is that I'm either exceeding the maximum number of requests in the BatchWriteRequest 1000 per second), or I'm returning too much data (1MB of response data). I am trying to insert over 4000 items into my Aurora Serverless DB cluster, and it produces a Socket Exception each time. I'm not sure why it results in a SocketException and not a more descriptive error, the Aurora Data API should handle these requests better or at least mention these limits in the AWS SDK documents. I resolved this by partitioning the requests into groups of 500, and executing batch writes for each group in parallel. This workaround allows me to avoid the max number of requests per second limit as well as the response data limit. Leaving this here in case anyone else encounters this issue.
Hi @drewsb,
Thanks for the update. I agree that the Aurora Data API should handle these errors in a more descriptive way. I will try to have a look at the SDK code.
Please advise if you would like to keep this issue open or if we could close it.
Thanks, Ashish
This is resolved. Appreciate the help @ashishdhingra .
Description
I am currently creating a lambda function which calls the IAmazonRDSDataService method BatchExecuteStatementAsync(BatchExecuteStatementRequest, CancellationToken) to batch write multiple insert requests into my Aurora Serverless DB Cluster. The request executes for approximately 30 seconds then fails with an error message.
I am able to successfully call ExecuteStatementAsync, so I know I am able to connect to my database. If I just call await _dataService.BatchExecuteStatementAsync(request).ConfigureAwait(false); without returning a response back to my lambda function, the lambda function completes without throwing an exception but never inserts any items into the database. Whenever something is returned by IAmazonRDSDataService , my guess is this forces the lambda to block the thread until a response has created, however I always receive this exception: Unable to read data from the transport connection: Broken pipe.
Reproduction Steps
Code:
Logs
Stack Trace:
Environment
Resolution
This is a :bug: bug-report