Commit f9f1dd92 authored by Santiago Gimeno's avatar Santiago Gimeno Committed by Rich Trott
Browse files

cluster: ignore queryServer msgs on disconnection

It avoids the creation of unnecessary handles. This issue is causing
intermitent failures in `test-cluster-disconnect-race` on `FreeBSD`
and `OS X`.

The problem is that the `worker2.disconnect` is being called on the
master before the `queryServer` is handled, causing the worker to
be deleted, then the Server handle is created afterwards. Later on,
when `removeWorker` is called from the `exit` handler, there are no
workers left, but one handle, thus the `AssertionError`.

Add a new `test/sequential/test-cluster-disconnect-leak` based on
`test-cluster-disconnect-race` that creates lots of workers and fails
consistently without this patch.

PR-URL: https://github.com/nodejs/node/pull/4465


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarJohan Bergström <bugs@bergstroem.nu>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
parent b46c627e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment