joyent/node — pull request #6802 by trevnorris (2014-01-04 07:05:30+00:00)
Title: net: run close callbacks in correct eloop phase

Instead of running the close callbacks seemingly synchronously instead
of when the handle has actually been closed by libuv, instead run the
callbacks in the uv__run_closing_handles() phase of the eloop.

There's an issue with the cluster module overriding the `close()` callback that prevents the callbacks from being executed at the correct time.

@bnoordhuis, if you're still around I could use some feedback of how to fix this with the cluster module.