nodejs / nodejs/undici

Limit the maximum numbers of open sockets

Open
#3,268 22 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

One of the first issues with "fetch failed" is that we don't limit the number of outgoing sockets, and the process runs out of them, triggering a timeout error.

I think we should add a limit of 127 per pool by default (or any other magic number)

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 by tracing the pool and outgoing-socket management entry points in Undici, then review how socket exhaustion currently leads to fetch failures and timeouts. Done means each pool has a documented default maximum for open outgoing sockets and coverage verifies that the limit is enforced without breaking normal requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.