Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retry on closed connection #189

Merged
merged 3 commits into from
Jul 21, 2020
Merged

Retry on closed connection #189

merged 3 commits into from
Jul 21, 2020

Conversation

eminugurkenar
Copy link
Contributor

@eminugurkenar eminugurkenar commented Jul 13, 2020

We upload large amount of data to s3 and after upgrading version 1.0.0 , we experienced failures for large uploads , randomly we get errors like below.

RequestError: send request failed caused by: Put "https://testing.s3.amazonaws.com/xxxxx&partNumber=n&uploadId=id": write tcp 10.xx.xx.xx:41654->52.216.8.115:443: use of closed network connection

After digging AWS SDK ShouldRetry method, we noticed that for some cases it does return false but for some cases it returns true even if base error says use of closed network connection in both cases, you can see below

SerializationError: failed to unmarshal error message status code: 500, request id: IDDDDDDD, host id: 3231sdsadasdasdI= caused by: UnmarshalError: failed to unmarshal error message caused by: read tcp 10.xx.xx.xx:39860->52.216.166.67:443: use of closed network connection: true

RequestError: send request failed caused by: Put "https://testing.s3.amazonaws.com/xxxx?partNumber=n&uploadId=id--": write tcp 10.xx.xx.xx:41654->52.216.8.115:443: use of closed network connection: false

So we implemented this patch to retry on any error that contains use of closed network connection , as golang does not export this error https://github.com/golang/go/issues/4373 , we had to check error msg.

@ilkinulas ilkinulas requested review from igungor and ilkinulas July 14, 2020 07:17
Copy link
Member

@igungor igungor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you update S3Retry test?

@ilkinulas ilkinulas merged commit a4865c1 into peak:master Jul 21, 2020
seruman added a commit that referenced this pull request Jul 22, 2020
@seruman seruman mentioned this pull request Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants