nodejs / nodejs/undici

spec doesn't finalize connection on network error

Open
#948 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I've been reading through the spec a few times now and there seems to be missing a connection cleanup somewhere.

The problem is that whenever we replace response with a network error (example) that means that we no longer will read that response nor do we close the associated connection. Effectively leaking the connection.

Is this a bug in the spec or am I missing something? Maybe we need a "terminate" in fetch finale?

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 in lib/fetch/index.js around line 503 and trace how a response becomes a network error during fetch finale. Compare that flow with the spec's connection-lifecycle requirements and determine where cleanup is expected. Done means the network-error path no longer leaves the associated connection unfinalized.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.