nodejs / nodejs/undici

Timeout breaking change

Open
#4,055 7 comments 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

The bug was introduced in v6.20, the timeout that is set less than a second is ignored, Its a breaking change in minor version

server

const Fastify = require('fastify')
const fastify = Fastify()

fastify.all('*', async (req, reply) => {
  await new Promise((resolve) => setTimeout(resolve, 500))
  return reply.status(200).send(req.url)
});


fastify.listen({ port: 3000 })

client

const undici = require('undici')

undici.request('http://localhost:3000', {
  headersTimeout: 300,
}).then((response) => {
  console.log(response.statusCode)
})

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

Start with the provided Fastify server and undici.request reproduction, then trace the client timeout handling that is triggered by headersTimeout. Confirm the behavior for a timeout below one second and identify the existing timeout tests, if any; done means the reported sub-second timeout is honored without changing other timeout behavior.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.