Skip to content

broken behavior of server.close and keepAlive in node v18.19.0 and above. Works as expected until v18.18.2 #52330

@kumarrishav

Description

@kumarrishav

Version

18.19.0

Platform

Darwin XXXXXXX 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:43 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6000 arm64

Subsystem

No response

What steps will reproduce the bug?

Mentioned in this discussion:
https://github.com/orgs/nodejs/discussions/52224#discussioncomment-8987176

After digging more, I found that this behavior started in node v18.19.0 .

It worked fine until v18.18.2

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

There shouldn't be a broken behavior in minor release

What do you see instead?

failure

error Error: socket hang up
    at connResetException (node:internal/errors:720:14)
    at Socket.socketOnEnd (node:_http_client:525:23)
    at Socket.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'ECONNRESET'
}
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: socket hang up
    at connResetException (node:internal/errors:720:14)
    at Socket.socketOnEnd (node:_http_client:525:23)
    at Socket.emit (node:events:529:35)
    at endReadableNT (node:internal/streams/readable:1400:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'ECONNRESET'
}

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions