Skip to content

fix: inf retry budget timeout cap, AdaptiveClient(read_timeout=None), and dynamic flush pin order - #134

Merged
davanstrien merged 1 commit into
mainfrom
fix/timeout-cap-client-and-sink-pin
Nov 30, 2026
Merged

davanstrien merged 1 commit into
mainfrom
fix/timeout-cap-client-and-sink-pin

Conversation

@davanstrien

@davanstrien davanstrien commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Three small correctness edge-case fixes:

  1. Infinite retry budget + unlimited timeout (saturate/http.py, saturate/transport.py): pump(..., read_timeout=None, retry_budget_s=math.inf) is explicitly allowed by PUMP_SETTINGS, but on retry 1 Timeouts.capped(math.inf) turned None/0 phases into inf and aiohttp's ceil_timeout(inf) raised OverflowError: cannot convert float infinity to integer — bypassing call_endpoint()'s retry handler (failing the row as client: OverflowError in pump(), or raising directly from AdaptiveClient.post()). Timeouts.capped() now returns self for math.isinf(cap), and _send() skips capping/wait_for when math.isinf(left).
  2. AdaptiveClient(read_timeout=None) (saturate/core.py): now raises ValueError("AdaptiveClient requires retry_budget_s when read_timeout is None") (matching pump()) instead of a bare TypeError on 2 * None, and types read_timeout: float | None = 1800.0. (read_timeout=0 keeps its existing tested behaviour.)
  3. Dynamic schema pin timing (saturate/sink.py): ParquetSink.flush() now computes the next dynamic schema without mutating self._schema/self._pinned until after _write_hf_flush() / _write() succeeds, so a failed flush cannot leave unlanded columns pinned on the sink.

Testing

  • Added tests in tests/test_pump_settings.py:
    • Timeouts.capped(math.inf) preserves unlimited phases (for_aiohttp().total is None).
    • test_infinite_retry_budget_with_no_read_timeout_retries_cleanly: end-to-end pump(read_timeout=None, retry_budget_s=math.inf) with a 503 on attempt 1 retries cleanly and lands all rows.
    • test_adaptive_client_requires_retry_budget_when_read_timeout_is_none: ValueError without retry_budget_s, succeeds with one.
  • Added test_failed_dynamic_flush_does_not_pin_unlanded_schema in tests/test_sinks.py.
  • Full fast suite (772 passed, 30 skipped), ruff check, ruff format --check, and ty check saturate tests all green.

@davanstrien
davanstrien merged commit c151421 into main Nov 30, 2026
18 checks passed
@davanstrien
davanstrien deleted the fix/timeout-cap-client-and-sink-pin branch November 30, 2026 21:16
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