-
Notifications
You must be signed in to change notification settings - Fork 7.3k
AIX: ENOTCONN error thrown in spawnSync #9444
Comments
nodejs/node#1214 LGTM, thank you @gireeshpunathil! |
I'll create the pull request to move it across |
Created pull request #14480 |
I tried pulling in but I saw this error (on osx64), along with a failure on linux which I could not reproduce in my local build with the change. Gireesh could you see if you can recreate this on on osx with/without the change. Since it is a test in the same set as the one we were trying to fix (test-child-process-xxx) it may be that the change has introduced an issue for this test. duration_ms: 0.604
...
not ok 33 - test-child-process-fork-getconnections.js
#/Development/jenkins/workspace/node-test-commit-unix/ea9f5537/test/simple/test-child-process-fork-getconnections.js:39
# throw new Error('[c] closing by accident!');
# ^
#Error: [c] closing by accident!
# at Socket.<anonymous> (/Development/jenkins/workspace/node-test-commit-unix/ea9f5537/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)
#/Development/jenkins/workspace/node-test-commit-unix/ea9f5537/test/simple/test-child-process-fork-getconnections.js:57
# throw new Error('child died unexpectedly!');
# ^
#Error: child died unexpectedly!
# at ChildProcess.<anonymous> (/Development/jenkins/workspace/node-test-commit-unix/ea9f5537/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)
---
duration_ms: 0.507
... |
@mdawsonibm, I am able to reproduce this reported error in OSX (but not in linux), WITH and WITHOUT this change. The precondition for this failure is heavy stress in the system. 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. So in short, this issue is not related to the proposed change, and is a pre-existing one. |
Ok thanks will try to pull in again |
This is a backport of ea37ac0 Original commit message: On AIX, OS X and the BSDs, calling shutdown() on one end of a pipe when the other end has closed the connection fails with ENOTCONN. The sequential/test-child-process-execsync test failed sporadically because of a race between the parent and the child where one closed its end of the pipe before the other got around to calling shutdown() on its end of the pipe. Libuv is not the right place to handle that because it can't tell if the ENOTCONN error is genuine but io.js can. Refs: libuv/libuv#268 PR-URL: iojs#1214 Reviewed-By: Bert Belder <[email protected]> Fixes: #9444. Reviewed-By: Julien Gilli <[email protected]> PR-URL: #14480
@mdawsonibm @gireeshpunathil Would you mind creating an issue regarding Also see related issue in io.js: nodejs/node#1100. |
@misterdjules , done - #16805 |
@gireeshpunathil Thank you! |
On AIX we were seeing failures in the Node test:
simple/test-child-process-execsync.js
/bin/sh: iamabadcommand: not found.
child_process.js:1382
throw err;
^
Error: spawnSync ENOTCONN
at exports._errnoException (util.js:746:11)
at spawnSync (child_process.js:1321:20)
at execSync (child_process.js:1373:13)
....
This is also reproducible in OS X, under heavy stress in
the system. The issue is root caused by a race condition between
the parent and child where the short lived child (such as bad
command used in the test case) closed its end of the pipe
before the parent called the shutdown() on its end of the pipe.
A pull request is present in io.js on the same:
nodejs/node#1214
Request to pull this change to Node.js as well.
Thanks
The text was updated successfully, but these errors were encountered: