Repository navigation
Conversation
Refresh idle NAT and load-balancer flows while partition requests wait for response headers. Enable SO_KEEPALIVE with 60s idle, 30s interval and five probes on SDK-owned sync, async and split-PDF transports. Resolve supported platform options defensively and expose validated environment overrides. Caller-provided clients retain their existing transport configuration. HTTPX 0.28 disables environment proxy discovery when transport is supplied. Rebuild its environment proxy mounts with get_environment_proxies, including NO_PROXY exclusions, and apply socket options to proxy transports as well. Move split-PDF limits, verify and cert into every transport so these settings remain effective. Log resolved probe settings alongside pool and TLS settings. Keep the changelog entry under 0.46.3: no corresponding remote tag or GitHub release exists. Generation was decommissioned in cb867f0; .genignore is absent from the current checkout, and the SDK entry point is maintained by hand. Validation: make lint (pylint 10.00/10, mypy clean); make test-unit (353 passed, 1 xfailed). A Docker MASQUERADE router with a 20s conntrack timeout and a 45s server delay returned 200 at 45.0s with keepalive idle/interval 5s; disabling keepalive produced ReadTimeout at 90.0s.
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Shadow auto-approve: would not auto-approve because issues were found.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Shadow auto-approve: would not auto-approve. This PR does not meet the repository auto-approval settings.
View guided diff | Re-trigger cubic
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.
What
Partition requests that take longer than a few minutes now return their response when the client is behind a NAT or load balancer that drops idle connections. The SDK's own HTTP clients now send TCP keepalive probes while they wait. That covers the default sync and async clients and the split-PDF client.
It is on by default (60 s idle, 30 s interval, 5 probes). It can be tuned or turned off with
UNSTRUCTURED_CLIENT_TCP_KEEPALIVE,UNSTRUCTURED_CLIENT_TCP_KEEPALIVE_IDLE,UNSTRUCTURED_CLIENT_TCP_KEEPALIVE_INTERVALandUNSTRUCTURED_CLIENT_TCP_KEEPALIVE_COUNT. The split-PDFplan_createdandbatch_async_startlogs show the setting in use.Why
Long-running partition requests can exceed a NAT gateway’s idle timeout, causing responses to be lost while the client waits for its read timeout. This change enables TCP keepalive to keep those connections active.
Neither httpx nor the SDK turns on keepalive, and the OS keepalive settings only apply to sockets that ask for it. That makes the SDK, which opens these sockets, the place to fix it.
Unchanged:
client=/async_client=) are not modified.HTTP(S)_PROXY/NO_PROXYworks as before. Connections made through a proxy do not get keepalive, because httpcore drops socket options for proxied connections.Validation
SO_KEEPALIVEand every idle, interval and count setting. They also cover the bounds on the environment values, proxy routing and parity of TLS, limits and timeouts.200at 45 s;ReadTimeoutat 90 s.