UD-16960 Timeouts#303
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR bumps the SDK version to 1.3.0 and introduces a configurable per-request HTTP timeout that is passed to requests, while keeping the existing timeout parameter as the overall retry/backoff time budget.
Changes:
- Add
request_timeouttoConfigurationandUnitinitialization, with validation plus getters/setters. - Pass
timeout=...into allrequests.*calls and retryrequestsnetwork exceptions viabackoff.on_exception(with idempotency-aware giveup logic forpost_create). - Update version strings in
setup.pyand request headers, plus README documentation for the new timeout behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
unit/utils/configuration.py |
Adds request_timeout config, validation, and exposes getter/setter; bumps X-UNIT-SDK header version. |
unit/api/base_resource.py |
Adds retry-on-network-exception behavior and passes per-attempt timeout into requests calls; adds idempotency-aware giveup logic for post_create. |
unit/__init__.py |
Extends Unit initializer to accept request_timeout and wires it into Configuration creation. |
setup.py |
Bumps package version to 1.3.0. |
README.md |
Documents the new per-request timeout and clarifies the role of the existing timeout parameter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+36
to
+37
| def __init__(self, api_url=None, token=None, retries=0, timeout=120, request_timeout=120, | ||
| configuration: Configuration = None): |
Comment on lines
+61
to
+62
| # Per-request HTTP timeout passed to requests. Must be a positive int; | ||
| # 0 / None are rejected to avoid the historical "hang forever" behavior. |
ilyamerman
approved these changes
Jun 3, 2026
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.
Changes