{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-php/issues/768","labels_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/768/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/768/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/768/events","html_url":"https://github.com/aws/aws-sdk-php/issues/768","id":106965485,"number":768,"title":"400 BAD REQUEST leads to infinity retries using CommandPool | SDK 3.3.5","user":{"login":"sashless","id":1218924,"avatar_url":"https://avatars.githubusercontent.com/u/1218924?v=3","gravatar_id":"","url":"https://api.github.com/users/sashless","html_url":"https://github.com/sashless","followers_url":"https://api.github.com/users/sashless/followers","following_url":"https://api.github.com/users/sashless/following{/other_user}","gists_url":"https://api.github.com/users/sashless/gists{/gist_id}","starred_url":"https://api.github.com/users/sashless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sashless/subscriptions","organizations_url":"https://api.github.com/users/sashless/orgs","repos_url":"https://api.github.com/users/sashless/repos","events_url":"https://api.github.com/users/sashless/events{/privacy}","received_events_url":"https://api.github.com/users/sashless/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-17T11:43:08Z","updated_at":"2015-09-17T11:46:37Z","closed_at":null,"body":"aws-sdk-php/3.3.5 GuzzleHttp/6.1.0 curl/7.35.0 PHP/5.6.10\r\n\r\nI am using the Command Pool like this\r\n\r\n```php\r\n         $command = $this->s3Client->getCommand('PutObject', $commandConfig);`\r\n\r\n         $pool = new CommandPool($client,[$command], [\r\n            'fulfilled' => function (ResultInterface $result) use (&$results) {\r\n                $this->onUploadSucces($result, $results);\r\n            },\r\n            'rejected' => function (AwsException $reason) use (&$results) {\r\n                $this->onUploadError($reason, $results);\r\n            },\r\n        ]);\r\n\r\n        $promise = $pool->promise();\r\n        $promise->wait();\r\n```\r\n\r\nThe body of the Command is an Image or a PDF File and its working fine except for one file i found on github.\r\n\r\nWhen i try to upload that file the CommandPool gets stuck in between the execution \r\n\r\nThe response is \r\n\r\n```\r\n<Error><Code>RequestTimeout</Code><Message>Your socket connection to the server was not read from or written to within the timeout period. Idle connections will be closed.</Message><RequestId>F65194542FABDE8A</RequestId><HostId>xS7b/b/wnGYZJ2CftOzMeEURPIVSyMacP2nt0LQFZ76+kX/Embz4J65DMS2PaJna</HostId></Error>\r\n```\r\n\r\nThe problem with this is its not calling the `rejected` callback. It is retrying until the end of the world.\r\n\r\n```\r\n User-Agent: aws-sdk-php/3.3.5 GuzzleHttp/6.1.0 curl/7.35.0 PHP/5.6.10#015\r\nSep 17 11:33:42  Content-Length: 1016315#015\r\nSep 17 11:33:42  #015\r\nSep 17 11:33:42  < HTTP/1.1 400 Bad Request#015\r\nSep 17 11:33:42  < x-amz-request-id: 4FAE8098B6FC8563#015\r\nSep 17 11:33:42  < x-amz-id-2: Deusx9qYwW24m38gX9MRjk4HWuvWyHYa81JG/PxDNp4f0gfTPeM7IVJNU5H/LFsB#015\r\nSep 17 11:33:42  < Content-Type: application/xml#015\r\nSep 17 11:33:42  < Transfer-Encoding: chunked#015\r\nSep 17 11:33:42  < Date: Thu, 17 Sep 2015 11:33:22 GMT#015\r\nSep 17 11:33:42  < Connection: close#015\r\nSep 17 11:33:42  * Server AmazonS3 is not blacklisted\r\nSep 17 11:33:42  < Server: AmazonS3#015\r\nSep 17 11:33:42  < #015\r\nSep 17 11:33:42  * Closing connection 4\r\n```\r\n\r\nI can provide more debug output like more verbose network logging etc if necessary"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-php/issues/comments/141051786","html_url":"https://github.com/aws/aws-sdk-php/issues/768#issuecomment-141051786","issue_url":"https://api.github.com/repos/aws/aws-sdk-php/issues/768","id":141051786,"user":{"login":"sashless","id":1218924,"avatar_url":"https://avatars.githubusercontent.com/u/1218924?v=3","gravatar_id":"","url":"https://api.github.com/users/sashless","html_url":"https://github.com/sashless","followers_url":"https://api.github.com/users/sashless/followers","following_url":"https://api.github.com/users/sashless/following{/other_user}","gists_url":"https://api.github.com/users/sashless/gists{/gist_id}","starred_url":"https://api.github.com/users/sashless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sashless/subscriptions","organizations_url":"https://api.github.com/users/sashless/orgs","repos_url":"https://api.github.com/users/sashless/repos","events_url":"https://api.github.com/users/sashless/events{/privacy}","received_events_url":"https://api.github.com/users/sashless/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T11:46:37Z","updated_at":"2015-09-17T11:46:37Z","body":"In addition i tried to limit the retries ( default is 3 from viewing the docs ) but that has no result..\r\n\r\n```\r\n 'credentials' => [\r\n            'key' => 'xx',\r\n            'secret' => 'xx',\r\n        ],\r\n        'region' => 'us-east-1',\r\n        'version' => '2006-03-01',\r\n        'http'    => [\r\n            'connect_timeout' => 5\r\n        ],\r\n        'retries' => 1,\r\n        'debug' => [\r\n            'logfn'        => function ($msg) { echo $msg . \"\\n\"; },\r\n        ]\r\n```"}}