Skip to content

fix(http): stop long queries from failing after 6 minutes - #169

Merged
utay merged 1 commit into
mainfrom
fix/disable-native-fetch-idle-timeout
Oct 22, 2026
Merged

utay merged 1 commit into
mainfrom
fix/disable-native-fetch-idle-timeout

Conversation

@utay

@utay utay commented Oct 22, 2026

Copy link
Copy Markdown
Member

What

Disable the runtime's built-in fetch idle timeout (timeout: false for Bun, headersTimeout/bodyTimeout: 0 for undici). The CLI's own --connect-timeout and --read-timeout are now the only limits.

Why

Bun's fetch aborts a response that sends no bytes for 300s (360s in practice on Bun 1.4.3), regardless of the request's AbortSignal. A long /query sends its headers, then nothing until the statement finishes, so every query running longer than 6 minutes failed with Request failed (network error): POST …/query (The operation timed out.), whatever the timeout flags said. The statement kept running server-side. A customer hit this on long CREATE TABLE … AS loads.

Verification

  • Reproduced with Bun 1.4.3: a server that sends headers then stays silent for 7 minutes fails at 360.3s by default and completes with timeout: false.
  • Unit test asserts buildFetchInit disables the native timeout, with and without --ignore-ssl-errors.
  • bun run check --quick passes.

Checklist

  • Tests added or updated
  • CHANGELOG.md updated
  • No breaking changes

Made with Cursor

…eries

Bun's fetch aborts a response that stays silent for 300s (360s in practice
on Bun 1.4.3), independently of the request's AbortSignal. A long-running
/query sends its headers and then nothing until the statement finishes, so
any query over ~6 minutes failed with "Request failed (network error): POST
.../query (The operation timed out.)", whatever --connect-timeout and
--read-timeout said, while the statement kept running server-side.

Pass timeout: false to Bun's fetch and disable undici's headersTimeout and
bodyTimeout, so the CLI's own connect and read timeouts are the only limits
and --read-timeout 0 is unlimited for streams, as documented.

Co-authored-by: Cursor <cursoragent@cursor.com>
@utay utay self-assigned this Oct 22, 2026
@utay
utay requested a review from fvaleye October 22, 2026 14:04
@utay
utay enabled auto-merge (squash) October 22, 2026 14:09
@utay
utay merged commit b69e6aa into main Oct 22, 2026
15 checks passed
@utay
utay deleted the fix/disable-native-fetch-idle-timeout branch October 22, 2026 14:11
utay pushed a commit that referenced this pull request Oct 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.13.2](v1.13.1...v1.13.2)
(2026-10-22)


### Bug Fixes

* **http:** stop long queries from failing after 6 minutes
([#169](#169))
([b69e6aa](b69e6aa))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants