Skip to content

net.server.listen reusePort option being used on unsupported platforms, results in server termination #61018

@ajchili

Description

@ajchili

For Windows, MacOS, or any Linux distro not specified on the docs page, passing the reusePort=true option for net.server.listen results in server termination.

Is it required that a server terminates in this case, or can there be a graceful fallback for unsupported systems (e.g. default to false on systems that do not support SO_REUSEPORT)?

It appears that there is prior art for platform specific behavior. Could we use a similar pattern to gracefully handle reusePort?

node/lib/net.js

Lines 1852 to 1861 in e28656a

if (isWindows) {
const instances = NumberParseInt(process.env.NODE_PENDING_PIPE_INSTANCES);
if (!NumberIsNaN(instances)) {
handle.setPendingInstances(instances);
}
}
} else {
handle = new TCP(TCPConstants.SERVER);
isTCP = true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions