-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
intermittent unexpected socket closure on Mac OS X #2610
Comments
This retains the key elements of test-child-process-fork-getconnections (forks a child process, sends a bunch of sockets, uses getConnections() to enumerate them) but contains some code to work around an apparent intermittent bug that occurs on OS X where a socket seems to close itself unexpectedly. nodejs#2610 was opened for the bug that was causing the problem in the first place. PR-URL: nodejs#2609 Fixes: nodejs#1100
This retains the key elements of test-child-process-fork-getconnections (forks a child process, sends a bunch of sockets, uses getConnections() to enumerate them) but contains some code to work around an apparent intermittent bug that occurs on OS X where a socket seems to close itself unexpectedly. #2610 was opened for the bug that was causing the problem in the first place. PR-URL: #2609 Fixes: #1100 Reviewed-By: jbergstroem - Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
This retains the key elements of test-child-process-fork-getconnections (forks a child process, sends a bunch of sockets, uses getConnections() to enumerate them) but contains some code to work around an apparent intermittent bug that occurs on OS X where a socket seems to close itself unexpectedly. #2610 was opened for the bug that was causing the problem in the first place. PR-URL: #2609 Fixes: #1100 Reviewed-By: jbergstroem - Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
This retains the key elements of test-child-process-fork-getconnections (forks a child process, sends a bunch of sockets, uses getConnections() to enumerate them) but contains some code to work around an apparent intermittent bug that occurs on OS X where a socket seems to close itself unexpectedly. nodejs#2610 was opened for the bug that was causing the problem in the first place. PR-URL: nodejs#2609 Fixes: nodejs#1100 Reviewed-By: jbergstroem - Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
@Trott any chance we could stick a loop inside the test? That way the error is easier to reproduce? |
@brendanashworth The code pasted above will run in an infinite loop until the bug is triggered. (Note the call to Ideally, it would be refactored in a way that would trip the bug without running over and over and over. But doing that would require knowing what is causing the bug... |
Although running it now, it's not throwing with the |
This retains the key elements of test-child-process-fork-getconnections (forks a child process, sends a bunch of sockets, uses getConnections() to enumerate them) but contains some code to work around an apparent intermittent bug that occurs on OS X where a socket seems to close itself unexpectedly. #2610 was opened for the bug that was causing the problem in the first place. PR-URL: #2609 Fixes: #1100 Reviewed-By: jbergstroem - Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
This retains the key elements of test-child-process-fork-getconnections (forks a child process, sends a bunch of sockets, uses getConnections() to enumerate them) but contains some code to work around an apparent intermittent bug that occurs on OS X where a socket seems to close itself unexpectedly. #2610 was opened for the bug that was causing the problem in the first place. PR-URL: #2609 Fixes: #1100 Reviewed-By: jbergstroem - Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
This retains the key elements of test-child-process-fork-getconnections (forks a child process, sends a bunch of sockets, uses getConnections() to enumerate them) but contains some code to work around an apparent intermittent bug that occurs on OS X where a socket seems to close itself unexpectedly. #2610 was opened for the bug that was causing the problem in the first place. PR-URL: #2609 Fixes: #1100 Reviewed-By: jbergstroem - Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
This retains the key elements of test-child-process-fork-getconnections (forks a child process, sends a bunch of sockets, uses getConnections() to enumerate them) but contains some code to work around an apparent intermittent bug that occurs on OS X where a socket seems to close itself unexpectedly. #2610 was opened for the bug that was causing the problem in the first place. PR-URL: #2609 Fixes: #1100 Reviewed-By: jbergstroem - Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
For anyone stumped with this: Just use this little web server and run it. Then start a simple apache bench. You will see the ab either fail or be really slow. I can reproduce this after running the test 2 or 3 times. This was with version 0.12.4. Downgrading to 0.10.40 fixed it. # server.js
var http = require('http');
const PORT = 8080;
function handleRequest(request, response) {
response.end('reply');
}
var server = http.createServer(handleRequest);
server.listen(PORT, function() {
console.log("Server listening on: http://localhost:%s", PORT);
}) run it:
|
@Trott did this end up getting fixed? I know you had done a lot of work on it |
@evanlucas I haven't looked at this in months, but I did just run master branch against the test code in the original issue report. Still fails.
|
@Trott this is the exact same weirdness I was experiencing with the tests in #4819 https://github.com/nodejs/node/pull/4819/files#diff-e70e0e9b596132e4aa3b4bd4ced14515R60 |
@thealphanerd That's right! I'm pretty sure that workaround is in a number of our tests. Just to be clear so that no one sees that and closes this issue: This issue exists to document the actual bug. Users ideally shouldn't have to use a workaround that is basically "if you get an error, ignore it". |
Oh wait, I think I misunderstood you @thealphanerd. I may need to look at
|
@thealphanerd I think these are different bugs, or at least the workaround for #4819 does not seem to work here. I can't find a way to catch an error on the child process's Although I do wonder if this specific issue might be a "not a bug" sort of issue. I just added some code to track the number of calls to Thoughts? |
This now stalls out for me consistently after 1362 runs, after which I get |
Ref: #1100
Ref: nodejs/node-v0.x-archive#16805
The following code will throw on OS X. It might take a while but it will happen. I usually see the error before runcount hits 2000.
The text was updated successfully, but these errors were encountered: