test: ignore spurious 'EMFILE'
According to the explanation in #3635#issuecomment-157714683 And as a continuation to #5422 we also ignore EMFILE "No more file descriptors are available,so no more files can be opened" PR-URL: https://github.com/nodejs/node/pull/12698 Fixes: https://github.com/nodejs/node/issues/10286 Refs: https://github.com/nodejs/node/issues/3635#issuecomment-157714683 Refs: https://github.com/nodejs/node/pull/5178 Refs: https://github.com/nodejs/node/pull/5179 Refs: https://github.com/nodejs/node/pull/4005 Refs: https://github.com/nodejs/node/pull/5121 Refs: https://github.com/nodejs/node/pull/5422 Refs: https://github.com/nodejs/node/pull/12621#issuecomment-297701459 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
51664fc265
commit
6f216710eb
@ -1,3 +1,5 @@
|
||||
// Before https://github.com/nodejs/node/pull/2847 a child process trying
|
||||
// (asynchronously) to use the closed channel to it's creator caused a segfault.
|
||||
'use strict';
|
||||
|
||||
const common = require('../common');
|
||||
@ -33,11 +35,14 @@ const server = net.createServer(function(s) {
|
||||
worker.send({}, s, callback);
|
||||
});
|
||||
|
||||
// Errors can happen if this connection
|
||||
// is still happening while the server has been closed.
|
||||
// https://github.com/nodejs/node/issues/3635#issuecomment-157714683
|
||||
// ECONNREFUSED or ECONNRESET errors can happen if this connection is still
|
||||
// establishing while the server has already closed.
|
||||
// EMFILE can happen if the worker __and__ the server had already closed.
|
||||
s.on('error', function(err) {
|
||||
if ((err.code !== 'ECONNRESET') &&
|
||||
((err.code !== 'ECONNREFUSED'))) {
|
||||
(err.code !== 'ECONNREFUSED') &&
|
||||
(err.code !== 'EMFILE')) {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user