Repository navigation
fix(http): improve transient transport retries - #293
Conversation
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
There was a problem hiding this comment.
Verdict: 1 Low
Looks good — a deliberate, correct refinement of transient-vs-permanent DNS classification with solid socket-level test coverage. The narrowed marker set still fails fast on NXDOMAIN across Linux/macOS/Windows system-resolver phrasings while letting temporary resolver failures follow the idempotency retry policy, matching the PR intent. One low, non-blocking note on test hang-vs-fail robustness.
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
There was a problem hiding this comment.
Verdict: 1 Low
Looks good — the DNS reclassification is deliberate, correctly routed through is_connect()/is_request()/is_timeout(), and the three new socket-level tests (refused/dropped/timeout) exercise the intended paths. One low-severity edge: the narrowed permanent-DNS marker set is resolver-string-specific, so a permanent NXDOMAIN on a resolver with a non-matching message (e.g. musl) would now burn the retry budget instead of failing fast.
| if msg.contains("dns error") | ||
| || msg.contains("failed to lookup address") | ||
| || msg.contains("name or service not known") | ||
| if msg.contains("name or service not known") |
There was a problem hiding this comment.
🔵 Low — The narrowed marker set is tied to specific resolver phrasings — glibc Name or service not known, macOS nodename nor servname, Windows No such host, plus hickory-only nxdomain/non-existent domain. Because the generic fallbacks (dns error, failed to lookup address, name resolution) were removed, a permanent NXDOMAIN whose error string doesn't contain one of the retained phrases is now classified transient and retried until the full retry budget is exhausted — a regression from the previous fail-fast behavior for that host.
This is fine on glibc/macOS/Windows with the default getaddrinfo resolver, but musl (Alpine) returns a different EAI_NONAME string that matches none of the retained markers, so an NXDOMAIN there would consume all six attempts. If musl targets are in scope, consider keeping a permanent-only fallback (e.g. matching EAI_NONAME/not resolve phrasings) or add a musl-phrasing case to the marker list. Non-blocking — flagging the trade-off since the PR intentionally reclassifies DNS errors.
Treat temporary DNS resolver failures as retryable while continuing to fail fast for permanent unknown-host responses. The existing five-retry/six-attempt default remains unchanged.
Add socket-level coverage for connection refusal, dropped connections, and per-request timeouts.
Relationship to ADBC transport-error retry (adbc-drivers/databricks#373)
ADBC #373 added transport-level retry to the C# driver. The kernel's reqwest-based retry loop already covered most of that surface, so the only behavioral change here is around DNS; the rest is test coverage confirming pre-existing behavior.
is_connect()is_connect()/is_request().timeout()fires per attempt →is_timeout()Not matched, intentionally: no standalone transport-retry toggle; non-idempotent
ExecuteStatementretries onlyis_connect()to avoid double-execution.Tested with
cargo +stable fmt --all,cargo clippy --all-targets -- -D warnings, andcargo test.