-
Notifications
You must be signed in to change notification settings - Fork 7.3k
cluster: Need a way to listen on a port *without* going through master #3856
Comments
Is that really an issue? |
Yes. I'm seeing some issues in production that went away when I made it only have a single server handle shared with the parent. The problem is that the cluster master process seems to get confused about the worker's connected-ness status when it has two servers shared, and one of them closes. As a result, I had to call This hacky workaround is suitable for now, but is pretty ugly: // https://github.com/joyent/node/issues/3856
cluster.isWorker = false
cluster.isMaster = true
loneServer.listen(lonePort, function () {
cluster.isMaster = false
cluster.isWorker = true
logger.info("Listening on %d", lonePort)
}) |
Okay, so this issue is really a feature request and a bug report. :-) |
I agree that we need this. Didn't we sort of agree upon server.listen({port: 1234, shared: false}) ? |
@bnoordhuis This is that issue I said we already had when you brought this up yesterday. Added to v0.12 milestone. |
I may be wrong, but I don't think this is still a candidate for 0.12, is it? Just trying to trim down the milestone. |
Allow cluster workers to listen on exclusive ports for TCP and UDP, instead of forcing all calls to go through the cluster master. Fixes: #3856 Reviewed-by: Trevor Norris <trev.norris@gmail.com> Reviewed-by: Fedor Indutny <fedor@indutny.com>
Fixed by 029cfc1. |
Let's say you have 8 workers all listening on port 443 or port 80. Great.
Then, you have some sporadic bug. The bug report details show that it's on worker 5, and that worker is in some oddball state. The other workers are fine.
To try to reproduce the error, you have to have a way to make a request to the worker specifically. So, you can have the worker also listen on some specific port, like
10000 + worker.id
, with the same connection listener.However, it's a bit silly to have it request two handles from the master, when one of them is not shared with anything else.
The text was updated successfully, but these errors were encountered: