Repository navigation
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 intoNov 21, 2026
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Independent-review findings in the Python client:
stream_idle_timeout_ms=math.infpassed validation and then ended the sync thread for good (Condition.waitraisesOverflowErrorpastthreading.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 toTIMEOUT_MAXas a backstop.ValueError; a cache whose parse raised anything else (deep nesting →RecursionError, a custom storage'sTypeError) skipped opening the stream andconnect()never settled. Now any error is logged and ignored, and the stream opens in afinally(as Node does).RecursionError(andTypeErrorfor 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).pytest160/160,mypy --strictclean.