Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable httpx request timeout and increase default #3786

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dekkers
Copy link
Contributor

@dekkers dekkers commented Oct 31, 2024

Changes

This makes the timeout for outgoing requests configurable and increases the default timeout to 30.

QA notes

This touches most requests between services, so we should just test if OpenKAT in general still works.


Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@dekkers dekkers requested a review from a team as a code owner October 31, 2024 19:03
@dekkers dekkers force-pushed the make-httpx-timeout-configurable branch from e4b11ed to f3ad95e Compare October 31, 2024 19:05
@dekkers dekkers self-assigned this Oct 31, 2024
Copy link
Contributor

@ammar92 ammar92 left a comment

Choose a reason for hiding this comment

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

Nice work 👍 Just a few things:

  • The setting for Rocky seems to be named differently, why's that?
  • I suggest using a nullable float type for the timeout, since that's what httpx and most other request libraries accept. A float gives a bit more freedom and an int isn't necessarily easier, in fact you could still pass an integer and it will be implicitly cast to a float. And nullable for passing Nones, which explicitly means no timeout and could still be a useful setting.

base_url=base_url, headers={"Accept": "application/json"}, transport=(httpx.HTTPTransport(retries=3))
base_url=base_url,
headers={"Accept": "application/json"},
transport=(httpx.HTTPTransport(retries=3)),
Copy link
Contributor

Choose a reason for hiding this comment

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

Not your code, but the outer parentheses are redundant

Copy link

sonarcloud bot commented Nov 1, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
73.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review
Development

Successfully merging this pull request may close these issues.

2 participants