Repository navigation
Cherry pick #124557 to 26.8: Fix nested S3 request retries and read the error an S3 server sends before the whole request body - #130424
Conversation
`Client::doRequestWithRetryNetworkErrors` retried every retryable error outcome returned by the AWS SDK, but the SDK's own retry loop has already run the same `RetryStrategy` with `max_retries = s3_retry_attempts` for it, so a persistent retryable error was attempted `(s3_retry_attempts + 1)^2` times (251001 with the default of 500). The outer outcome retry was introduced in #84854 only for `s3_slow_all_threads_after_retryable_error`, where the SDK gets `max_retries = 1`; #90216 rewrote the loop and dropped that condition. Restore it: with the flag off, a non-success outcome is returned as is. Exceptions thrown out of the SDK while it reads a response body (the case #90216 added the loop for) are still retried by the outer loop. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…request body A server may answer a request it rejects right after reading its header and close the connection with the body unread. MinIO does this for an `UploadPart` whose multipart upload no longer exists (`404 NoSuchUpload`, e.g. after its stale-upload expiry). `PocoHTTPClient` writes the whole body before reading the response, so the write fails with `Broken pipe` or `Connection reset by peer`; Poco keeps that send error in the session and `receiveResponse` rethrows it before reading anything, so the 404 is never seen and the request is retried as a network error until the retry budget is spent, then fails with the network error instead of `NoSuchUpload`. When sending the body over plain HTTP fails with a `Poco::IOException` and response data is already waiting on the socket (non-blocking probe `getSocketState`), read that response with the new `HTTPClientSession::receiveEarlyResponse` and use it if its status is an error (>= 300). Otherwise the send error is rethrown as before. TLS is excluded: OpenSSL allows no further I/O after a failed `SSL_write`, so over HTTPS such an error is still retried as a network error (bounded by `s3_retry_attempts` after the previous commit). The `no_such_upload` action of the S3 mock gets an `early` mode that answers without reading the body and resets the connection, as MinIO does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Condense the receiveEarlyResponse doc to its contract and drop the expired-upload example from the PocoHTTPClient catch comment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rly-error-response Fix nested S3 request retries and read the error an S3 server sends before the whole request body
|
The conflict is in On the 26.8 tree (clang-22, debug) I cannot push to If 26.8 should get the second commit as well, tell me and I will resolve it with both. |
…ypick/26.8/124557 Resolve the conflict in `tests/integration/helpers/s3_mocks/broken_s3.py` by keeping the PR's `NoSuchUploadAction` and its `no_such_upload` dispatch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Original pull-request #124557
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Before you resolve anything
Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job