Skip to content

[BUG] (Regression) 'maxsockets' default config changed to 'Infinity' in v7.7.0 #2978

@wallrat

Description

@wallrat

What / Why

The maxsockets configuration have changed from 50 -> 'Infitinity' during the refactoring of the config defaults in #2878

This change reverts to the behavior before this option was added, where npm tries to fetch all dependencies in parallell, potentially opening 1000+ connections, which causes all sorts of problems for users network environments (firewalls, proxies etc.).

When

The regression happend in #2878 and was released in v7.7.0

I can't find any discussion as to why this default should be changed, so I conclude that is clearly a regression.

Where

  • n/a

How

Current Behavior

as of v7.7.0 the default is 'Infinity'

define('maxsockets', {
  default: Infinity,
  type: Number,
  description: `
    The maximum number of connections to use per origin (protocol/host/port
    combination).
  `,
  flatten (key, obj, flatOptions) {
    flatOptions.maxSockets = obj[key]
  },
})

https://github.com/npm/cli/blob/latest/lib/utils/config/definitions.js#L1156

Steps to Reproduce

  • n/a

Expected Behavior

The old, pre v7.7.0 default:

 maxsockets: 50,

https://github.com/npm/cli/pull/2878/files#diff-f3564a1ffcb1f2144f5fac275184e907dd8310250b6e83becfb45b70ae75be43L130

Who

@isaacs (merged @2878)

References

  • n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 0will get attention right awayRelease 7.xwork is associated with a specific npm 7 release

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions