Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

test: Incorrect end event callback invocation on socket #16805

@gireeshpunathil

Description

@gireeshpunathil

On OSX we were seeing failures in the Node test

test-child-process-fork-getconnections.js

This is only reproducible under heavy stress in
the network - more read/writes over the ports.

throw new Error('[c] closing by accident!');
^
Error: [c] closing by accident!
at Socket. (test/simple/test-child-process-fork-getconnections.js:39:17)
at Socket.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)

test/simple/test-child-process-fork-getconnections.js:57
throw new Error('child died unexpectedly!');
^
Error: child died unexpectedly!
at ChildProcess. (test/simple/test-child-process-fork-getconnections.js:57:13)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1074:12)

12 clients connect to a server, the sockets passed to a forked child,
and each of the sockets are closed, through a message passing between
the parent and child. child registers a call back on 'end' event of the
socket which should have never called because the sockets are destroyed
directly, but due to unknown reason, this end call back is fired causing
this issue.

Whatever be the race condition is, it is causing the socket to be closed
before they are destroyed, and thereby the end callback is triggered.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions