Skip to content

v0.2.0 · fix(sdk-python): bounded timers, a bad cache never blocks connect (review F-03, F-04, F-16) - #66

Merged
akosidencio merged 1 commit into
feat/v0.2.0-developer-adoptionfrom
fix/v0.2.0-python-review
Nov 21, 2026
Merged

akosidencio merged 1 commit into
feat/v0.2.0-developer-adoptionfrom
fix/v0.2.0-python-review

Conversation

@akosidencio

Copy link
Copy Markdown
Member

Independent-review findings in the Python client:

  • F-03 (medium): stream_idle_timeout_ms=math.inf passed validation and then ended the sync thread for good (Condition.wait raises OverflowError past threading.TIMEOUT_MAX); flags went stale while status still said streaming. Every millisecond option must now be finite and ≤ 2^31−1 ms (Node's timer ceiling); the loop clamps its wait to TIMEOUT_MAX as a backstop.
  • F-04 (medium): hydration caught only ValueError; a cache whose parse raised anything else (deep nesting → RecursionError, a custom storage's TypeError) skipped opening the stream and connect() never settled. Now any error is logged and ignored, and the stream opens in a finally (as Node does).
  • F-16 (low): stream/poll parsing also catch RecursionError (and TypeError for snapshot shapes).

Tests: hostile caches still connect; delay options bounded; a 1e12 s timer no longer ends the loop. Both regression tests fail on the previous code (checked locally: RecursionError … CheckgateTimeoutError). pytest 160/160, mypy --strict clean.

…blocks connect (review F-03, F-04, F-16)

- F-03: stream_idle_timeout_ms=inf passed validation and then ended the
  sync thread for good: Condition.wait raises OverflowError past
  threading.TIMEOUT_MAX. Every millisecond option is now finite and at most
  2^31-1 ms (Node's timer ceiling), and the loop's wait is clamped to
  TIMEOUT_MAX as a backstop.
- F-04: hydration caught only ValueError, so a cache whose parse raised
  anything else (deep nesting -> RecursionError, a custom storage's
  TypeError) skipped opening the stream and connect() never settled. Any
  error is now logged and ignored, and the stream opens in a finally.
- F-16: stream and poll parsing also catch RecursionError (and TypeError
  for snapshot shapes).

Tests: hostile caches (deep JSON, raising storage) still connect; delay
options bounded; a 1e12 s timer no longer ends the loop. Both new tests fail
on the previous code (checked). pytest 160/160, mypy --strict clean.
@akosidencio
akosidencio merged commit 0ce655f into feat/v0.2.0-developer-adoption Nov 21, 2026
7 checks passed
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