Skip to content

Handle truncated HTTP responses during gateway setup - #1250

Draft
yaoharry wants to merge 2 commits into
databricks:mainfrom
yaoharry:harry/kpi3-http-read-recovery
Draft

yaoharry wants to merge 2 commits into
databricks:mainfrom
yaoharry:harry/kpi3-http-read-recovery

Conversation

@yaoharry

Copy link
Copy Markdown
Contributor

Summary

A truncated or malformed HTTP response can raise http.client.HTTPException outside urllib's usual network exceptions, aborting gateway setup instead of returning a failure reason. Handle these failures in the shared HTTP helpers: GET callers use their existing bounded retry policy, and writes return a failure without replaying the request.

Test plan

  • All eight new regression cases failed on the original code. The complete tests/test_databricks.py suite now passes: 423 tests.
  • Covers truncated bodies, malformed status lines, zero and exhausted retry budgets, successful recovery using only the complete response, and single-attempt POST/PATCH/DELETE failures.
  • Repository-wide Ruff lint, format checks, and ty check src/ pass.
  • Transport faults are injected at the HTTP boundary; no live gateway recovery is claimed.

Harry Yao added 2 commits October 22, 2026 20:42
Signed-off-by: Harry Yao <harry.yao@databricks.com>
…-recovery

Signed-off-by: Harry Yao <harry.yao@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant