Skip to content

UD-16960 Timeouts#303

Merged
YegorZh merged 3 commits into
masterfrom
UD-16960-timeouts
Jun 3, 2026
Merged

UD-16960 Timeouts#303
YegorZh merged 3 commits into
masterfrom
UD-16960-timeouts

Conversation

@YegorZh
Copy link
Copy Markdown
Collaborator

@YegorZh YegorZh commented Jun 2, 2026

Changes

  • Version bump to 1.3.0
  • Added timeouts to requests

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_timeout to Configuration and Unit initialization, with validation plus getters/setters.
  • Pass timeout=... into all requests.* calls and retry requests network exceptions via backoff.on_exception (with idempotency-aware giveup logic for post_create).
  • Update version strings in setup.py and 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 thread unit/__init__.py Outdated
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 thread unit/utils/configuration.py Outdated
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.
@YegorZh YegorZh merged commit c877126 into master Jun 3, 2026
4 of 5 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.

3 participants