nodejs / nodejs/undici

how to set a timeout for long running queries?

Open
#1,919 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
7.7k
Forks
880
Avg merge
2d 16h
Merged PRs (30d)
68

Description

Hi,

i am having trouble finding a way to keep fetch running when i have to deal with long running queries.
i am talking about a minute max time. the query works fine in the browser, and returns 200.
undici seems to be waiting exactly 30s till it fails.

this is how my request init looks like: {"method":"GET","headers":{},"keepalive":true,"keepAliveInitialDelay":120000, "socketTimeout":0}
i am using undici 5.18.0. installed via npm.

Any idea how to solve that?

Cheers and Thanks!!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the 30-second failure with the shown request options in undici 5.18.0, then inspect the timeout-related configuration. Done means identifying the supported setting for a roughly one-minute query or documenting that the reported options do not control it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.