Repository navigation
Retry Azure client network and DNS errors instead of reporting a synthetic 500 - #115269
Conversation
…rors makeRequestInternalImpl caught client-side transport failures only via the terminal catch(...), turning them into a synthetic InternalServerError(500) response. Add catch(const Poco::IOException&) — covering the whole Poco::Net::NetException family (connection reset/refused, DNS, TLS) plus generic IO — and catch(const NetException&) for ClickHouse's own DB::NetException(DNS_ERROR) from makeHTTPSession, which is not a Poco::IOException. Both mirror the existing Poco::TimeoutException arm and throw Azure::Core::Http::TransportException, so network errors are retried unconditionally by the SDK rather than relying on 500 being in the retryable status set (matches the S3 client at src/IO/S3/PocoHTTPClient.cpp). Add azure_inject_poco_network_error[_once] failpoints and a "network" case in the test_azure_403_handling suite. Follow-up to #112871, addresses review comment #112871 (comment)
|
Workflow [PR], commit [7633f63] Summary: ✅
AI ReviewSummaryThis PR teaches the Azure HTTP transport to rethrow more client-side failures as retryable Tests
Final Verdict
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 39/40 (97.50%) · Uncovered code |
|
|
||
| throw Azure::Core::Http::TransportException(getCurrentExceptionMessageAndPattern(true).text); | ||
| } | ||
| catch (const NetException &) |
There was a problem hiding this comment.
This new branch is the one that turns DB::NetException from makeHTTPSession / HostResolver into a retryable TransportException, i.e. it is the actual DNS_ERROR path the PR body is promising. The added integration case only injects Poco::Net::ConnectionResetException, so it proves the Poco::IOException arm but still leaves this DNS-specific handler unexercised. Please add one focused regression test that forces a DB::NetException(DNS_ERROR) here and verifies we retry it instead of surfacing the synthetic 500 / reporting the part broken.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units11 translation units recompiled, 19 s compile time in total, 11 of them have a recent master baseline. |
containerExists() only assumed the container exists on a synthetic-500 StorageException, but transport/DNS failures now surface as a TransportException, which propagated out and aborted server startup (and Azure table DDL) against an unreachable endpoint. Catch TransportException too and assume-exists, mirroring the InternalServerError arm; real I/O keeps the retryable-propagation behaviour. Fixes test_azure_disk_unreachable::test_server_starts_with_unreachable_azure_disk and test_mask_sensitive_info::test_create_table.
On master the Azure transport now throws `TransportException` for a timeout or a broken connection (ClickHouse#112871, ClickHouse#115269) instead of returning a synthetic 408 or 500 from `PocoAzureHTTPClient`. `TransportException` carries no status code, so the status-only classifier reported a timed-out rename as a definite failure ("Rename failed: HTTP 0") and the destructor then claimed the file was unchanged, although the rename may have been applied. The classifier now takes the exception and treats a transport failure as ambiguous, which yields "commit status unknown" as for 408 and 5xx. A transport failure is also rendered with its explanation, which is in `what` rather than `Message`, instead of as `HTTP 0: `, and it is logged to `system.blob_storage_log` with a non-zero error code through `getAzureErrorCodeForLog`, as `WriteBufferFromAzureBlobStorage` does. `isRetryableAzureException` now retries a 403 unconditionally (ClickHouse#112871), so a 403 on the staging create is retried on the same staging name. The test for that path now checks that only one staging name is used, which is what it is about, rather than the number of requests. The test's request classifier now uses `contains`, which clang-tidy 22, the compiler version master pins now, requires. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#112871 fixed transient Azure timeouts being misreported as broken data parts. The
follow-up suggestion (#112871 (comment))
was to extend that to
Poco::Net::NetException,Poco::IOExceptionandDB::NetException,which the Azure HTTP client still turns into a synthetic
500.Changes:
Poco::IOException, which also coversPoco::Net::NetExceptionDB::NetExceptiontest_azure_disk_unreachable)Both new handlers throw
Azure::Core::Http::TransportException(retryable, like theexisting timeout handler) and match the S3 client.
Changelog category (leave one):
Changelog entry:
Azure client-side network failures (connection reset/refused, DNS and TLS errors) are now
retried as transport errors instead of surfacing as a synthetic
500, matching the S3client.
Workflow [PR]
Sync PR [sync-upstream/pr/115269]
Version info
26.8.1.1990(included in26.8and later)