{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-php/issues/983","repository_url":"https://api.github.com/repos/aws/aws-sdk-php","labels_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/983/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/983/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/983/events","html_url":"https://github.com/aws/aws-sdk-php/issues/983","id":153053401,"number":983,"title":"Proposal: CURLE_RECV_ERROR (56) should retry","user":{"login":"oberman","id":971773,"avatar_url":"https://avatars.githubusercontent.com/u/971773?v=3","gravatar_id":"","url":"https://api.github.com/users/oberman","html_url":"https://github.com/oberman","followers_url":"https://api.github.com/users/oberman/followers","following_url":"https://api.github.com/users/oberman/following{/other_user}","gists_url":"https://api.github.com/users/oberman/gists{/gist_id}","starred_url":"https://api.github.com/users/oberman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oberman/subscriptions","organizations_url":"https://api.github.com/users/oberman/orgs","repos_url":"https://api.github.com/users/oberman/repos","events_url":"https://api.github.com/users/oberman/events{/privacy}","received_events_url":"https://api.github.com/users/oberman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-04T16:12:05Z","updated_at":"2016-05-04T17:46:43Z","closed_at":null,"body":"The root issue: Guzzle considers CURLE_RECV_ERROR to be RequestException instead of a ConnectException which causes the AWS SDK to throw an service exception (like SqsException).  An example of Curl debugging when this happens to me:\r\n```\r\n* Hostname sqs.us-east-1.amazonaws.com was found in DNS cache\r\n*   Trying 54.239.27.144...\r\n* Connected to sqs.us-east-1.amazonaws.com (54.239.27.144) port 443 (#1)\r\n*   CAfile: /etc/pki/tls/certs/ca-bundle.crt\r\n  CApath: none\r\n* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256\r\n* Server certificate:\r\n*       subject: CN=queue.amazonaws.com,O=\"Amazon.com, Inc.\",L=Seattle,ST=Washington,C=US\r\n*       start date: Sep 25 00:00:00 2015 GMT\r\n*       expire date: Dec 23 23:59:59 2016 GMT\r\n*       common name: queue.amazonaws.com\r\n*       issuer: CN=Symantec Class 3 Secure Server CA - G4,OU=Symantec Trust Network,O=Symantec Corporation,C=US\r\n> POST XXX HTTP/1.1\r\nHost: sqs.us-east-1.amazonaws.com\r\nContent-Type: application/x-www-form-urlencoded\r\nX-Amz-Date: 20160504T115214Z\r\nAuthorization: AWS4-HMAC-SHA256 Credential=[KEY]/20160504/us-east-1/sqs/aws4_request, SignedHeaders=host;x-amz-date, Signature=[SIGNATURE]\r\nUser-Agent: aws-sdk-php/3.15.2 GuzzleHttp/6.2.0 curl/7.40.0 PHP/5.5.33\r\nContent-Length: 889\r\n\r\n* upload completely sent off: 889 out of 889 bytes\r\n* SSL read: errno -5961 (PR_CONNECT_RESET_ERROR)\r\n* TCP connection reset by peer\r\n* Closing connection 1\r\n```\r\n\r\nIt appears that issue #767 was resolved by patching S3Client to retry CURLE_RECV_ERROR (https://github.com/aws/aws-sdk-php/commit/2f985ba4cef6276cf4bb42741efa441bfc99a52c).  I agree with the patch, but feel any API request with this error should be retried.  "},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-php/issues/comments/216945391","html_url":"https://github.com/aws/aws-sdk-php/issues/983#issuecomment-216945391","issue_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/983","id":216945391,"user":{"login":"oberman","id":971773,"avatar_url":"https://avatars.githubusercontent.com/u/971773?v=3","gravatar_id":"","url":"https://api.github.com/users/oberman","html_url":"https://github.com/oberman","followers_url":"https://api.github.com/users/oberman/followers","following_url":"https://api.github.com/users/oberman/following{/other_user}","gists_url":"https://api.github.com/users/oberman/gists{/gist_id}","starred_url":"https://api.github.com/users/oberman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oberman/subscriptions","organizations_url":"https://api.github.com/users/oberman/orgs","repos_url":"https://api.github.com/users/oberman/repos","events_url":"https://api.github.com/users/oberman/events{/privacy}","received_events_url":"https://api.github.com/users/oberman/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T17:46:43Z","updated_at":"2016-05-04T17:46:43Z","body":"This is great information!  I agree it's clearly not appropriate for the SDK to blindly retry CURL_RECV_ERROR.\r\n\r\nI'm trying to figure out if there is a generic way of detecting which exceptions to retry if I know the call is idempotent.  I see that AwsException provides getAwsErrorType().  I think the possible values are null, \"client\" and \"server\" (strings) and I'd want to retry \"server\".  What about null?  It's hard to puzzle through from the code but I think it's null on connection errors.  I'm not sure what other conditions lead to null though..."}}