Permalink
Browse files

Retry if connection was reset by peer (ECONNRESET)

This error tends to happen here and there, and deserves similar retry treatment as other Net:HTTP errors.
  • Loading branch information...
1 parent 1edde7c commit c2fcbd6e77ec61d0caeb4202ae3d0ff2c624cfb5 @orenhe committed Mar 22, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/aws/s3/connection.rb
View
@@ -51,7 +51,7 @@ def request(verb, path, headers = {}, body = nil, attempts = 0, &block)
else
http.start(&requester)
end
- rescue Errno::EPIPE, Timeout::Error, Errno::EINVAL, EOFError
+ rescue Errno::EPIPE, Timeout::Error, Errno::EINVAL, EOFError, Errno::ECONNRESET
@http = create_connection
attempts == 3 ? raise : (attempts += 1; retry)
end

0 comments on commit c2fcbd6

Please sign in to comment.