Repository navigation
Conversation
SuhrudhC
marked this pull request as draft
October 6, 2026 15:37
Member
|
Closing at detailed in #123 |
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.
Problem and fix
Fixes #123.
The internal connection pool treats
pool_timeout=0.0asNonebecause deadline creation checks truthiness. An internal acquisition with zero timeout can therefore wait indefinitely when the pool is full.Scope after maintainer feedback: I have not established a reproduction through the SDK's supported public API. Both current
mainand the pendingv1.2.0branch constructOpenAQwith a default pool timeout ofNone; the constructor exposes no public pool-timeout setting, and_transportinjection is documented as internal use only. This is a defensive internal correction, with no demonstrated effect on ordinary public-client usage. The PR is draft pending maintainer direction on whether that scope is useful.Use
pool_timeout is not Noneinstead. Zero timeout now raisesTimeoutErrorimmediately when the pool is full, while an available new or idle connection can still be acquired. Positive timeouts andNoneretain their existing behavior.Validation
client.countries.list()calls with the real client, transport, and pool; only the HTTPS connection is mocked. With an internally injected zero-timeout transport and a full pool, the second client call blocks on the original implementation and raises the SDK'sTimeoutErrorwith the patch. Thepool=Nonecase still waits for capacity and completes successfully. Both cases also verify a later client request can reuse the released connection.v1.2.0branch; this PR targetsmainper the contribution guide and can be retargeted if preferred.Generated and validated with Codex. No API requests or production data were used for the regression tests.