Skip to content

fix(http): bump read/write timeout to 10s and reword timeout error#1344

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/JulianMaurin/fix/http-client-read-timeout/bump-read-write-timeout-10s-reword-timeout-error--ac0f395e
May 5, 2026
Merged

fix(http): bump read/write timeout to 10s and reword timeout error#1344
mergify[bot] merged 1 commit into
mainfrom
devs/JulianMaurin/fix/http-client-read-timeout/bump-read-write-timeout-10s-reword-timeout-error--ac0f395e

Conversation

@JulianMaurin
Copy link
Copy Markdown
Contributor

The shared httpx.AsyncClient was constructed with a flat timeout=5.0,
which httpx applies to every phase. GitHub's PR create/update regularly
takes longer than 5s under load, so transient slowdowns abort
mergify stack push mid-stack with httpx.ReadTimeout even though the
request was already sent and likely accepted server side.

Switch to httpx.Timeout(5.0, read=10.0, write=10.0): 10s absorbs
common hiccups while staying snappy enough for an interactive CLI to
fail fast on real outages — and discover_changes' head: search
makes re-running the push safe (already-created PRs are detected).

Also reword the friendly httpx.RequestError handler in main(): name
the upstream ("GitHub did not respond in time. The request was aborted
— please retry.") instead of pasting the raw URL and suggesting a
network check, which conflates a slow upstream with a broken network.

The shared httpx.AsyncClient was constructed with a flat `timeout=5.0`,
which httpx applies to every phase. GitHub's PR create/update regularly
takes longer than 5s under load, so transient slowdowns abort
`mergify stack push` mid-stack with `httpx.ReadTimeout` even though the
request was already sent and likely accepted server side.

Switch to `httpx.Timeout(5.0, read=10.0, write=10.0)`: 10s absorbs
common hiccups while staying snappy enough for an interactive CLI to
fail fast on real outages — and `discover_changes`' `head:` search
makes re-running the push safe (already-created PRs are detected).

Also reword the friendly `httpx.RequestError` handler in `main()`: name
the upstream ("GitHub did not respond in time. The request was aborted
— please retry.") instead of pasting the raw URL and suggesting a
network check, which conflates a slow upstream with a broken network.

Change-Id: Iac0f395e9f207d1c997d30dacdf385ecfdfb6fd0
Copilot AI review requested due to automatic review settings May 4, 2026 16:20
@mergify mergify Bot deployed to Mergify Merge Protections May 4, 2026 16:20 Active
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 4, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@JulianMaurin JulianMaurin marked this pull request as ready for review May 4, 2026 16:20
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

Adjusts the shared httpx.AsyncClient timeout policy and refreshes CLI transport-error messaging so interactive commands are less likely to fail on transient slow GitHub responses.

Changes:

  • Replaced the flat 5s HTTP timeout with structured httpx.Timeout(..., read=10.0, write=10.0).
  • Added a utility test that locks in the new connect/pool/read/write timeout values.
  • Reworded CLI request-error output and updated CLI tests to match the new user-facing messages.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
mergify_cli/utils.py Changes the default async HTTP client timeout configuration used across the CLI.
mergify_cli/tests/test_utils.py Adds regression coverage for the structured timeout settings.
mergify_cli/tests/test_cli.py Updates CLI tests for the revised timeout/network error wording.
mergify_cli/cli.py Refactors request-error handling to derive service name/exit code and emit new messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mergify_cli/cli.py
@mergify mergify Bot requested a review from a team May 4, 2026 16:34
@mergify mergify Bot requested a review from a team May 4, 2026 17:48
Comment thread mergify_cli/utils.py
@JulianMaurin
Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 fix(http): bump read/write timeout to 10s and reword timeout error #1344 👈
2 fix(rust): align timeout error message with python port #1347

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 5, 2026

Merge Queue Status

  • Entered queue2026-05-05 08:22 UTC · Rule: default
  • Checks skipped · PR is already up-to-date
  • Merged2026-05-05 08:24 UTC · at 22dd9934eb408c4e5dfd2c242b062f5ce1e2b3ef · squash

This pull request spent 1 minute 26 seconds in the queue, including 1 second running CI.

Required conditions to merge

@mergify mergify Bot merged commit 1a0e5a3 into main May 5, 2026
16 checks passed
@mergify mergify Bot deleted the devs/JulianMaurin/fix/http-client-read-timeout/bump-read-write-timeout-10s-reword-timeout-error--ac0f395e branch May 5, 2026 08:24
@mergify mergify Bot removed the queued label May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants