Implement a best effort approach to mitigating accept() EMFILE errors. We have a spare file descriptor stashed away that we close to get below the EMFILE limit. Next, we accept all pending connections and close them immediately to signal the clients that we're overloaded - and we are, but we still keep on trucking. There is one caveat: it's not reliable in a multi-threaded environment. The file descriptor limit is per process. Our party trick fails if another thread opens a file or creates a socket in the time window between us calling close() and accept(). Fixes #315. |
||
|---|---|---|
| .. | ||
| uv-private | ||
| uv.h | ||