Last active
October 28, 2015 16:19
-
-
Save watson/d3c222b3d7f1ca599b80 to your computer and use it in GitHub Desktop.
Debugging EBADF in Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(libuv) Failed to create kqueue (24) | |
(libuv) Failed to create kqueue (24) | |
events.js:72 | |
throw er; // Unhandled 'error' event | |
^ | |
Error: write EBADF | |
at errnoException (net.js:905:11) | |
at WriteStream.Socket._write (net.js:646:26) | |
at doWrite (_stream_writable.js:226:10) | |
at writeOrBuffer (_stream_writable.js:216:5) | |
at WriteStream.Writable.write (_stream_writable.js:183:11) | |
at WriteStream.Socket.write (net.js:616:40) | |
at Console.log (console.js:54:16) | |
at /Users/watson/code/node_modules/stackman/too-many-open-files.js:5:13 | |
at fs.js:208:20 | |
at Object.oncomplete (fs.js:108:15) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs') | |
for (var n = 0; n < 300; n++) { | |
fs.readFile(__filename, function () { | |
console.log() // just having a console log makes the program throw (see error.log) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs') | |
for (var n = 0; n < 300; n++) { | |
fs.readFile(__filename, function () { | |
// noop | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment