ENOBUFS - How to catch/deal with it?

15 views
Skip to first unread message

Jeremy Darling

unread,
Mar 26, 2012, 8:22:24 AM3/26/12
to nodejs, Hook.io
From everything that I've read this primarily deals with Windows and its ability to cache network communications.  I have a hook.io app that with occasionally bomb out with the ENOBUFS exception and for all of my efforts I can't figure out how to catch and deal with this error.

I realize that the exception is raised when the OS can no longer buffer up incoming/outgoing messages.  What I'm wondering is if there is a way to deal with it?  Can I write all incoming messages to a DB (MongoDB is our current DB) and minimalize this issue?  On outgoing is there a way to catch the issue, wait for the buffer to catch up, and then retry some how (again maybe a DB cache)?  How are others dealing with this when they see it?

try/catch doesn't seem to get notified and instead the app just exits writing basic details to the console.  This also appears to strand memory from what I can tell.  Of course it could also be the OS trying to catch up and basically giving up.

Any help greatly appreciated, I've copied both the Hook.io and Node.js groups in hopes that someone has/knows a work around or solution.

 - Jeremy

PS: An "easy" way to duplicate this (although in a completely different manor) is to have a hook that when called emits multiple calls to another hook, this in turn calls the caller a number of times as well.  This basically just sets up a quick scenario and is not what is happening in our production code.
Reply all
Reply to author
Forward
0 new messages