Unhandled rejection Error [ERR_IPC_CHANNEL_CLOSED]: channel closed #1
Načítá se…
x
Odkázat v novém úkolu
Zablokovat Uživatele
K dispozici není žádný popis.
Smazat větev „%!s()“
Smazání větve je trvalé. Přestože zrušená větev může existovat i po krátkou dobu, než bude skutečně odstraněna, NELZE ji většinou vrátit. Pokračovat?
Node Version: v10.15.1
greenlock-cluster@2.1.0
Note: This only occurs after the process has been idle for hours.
Also occurring in Node Version v8.15.0
Ok. This is a possible false alarm. Found evidence that my children are exiting unexpectedly. I'll need to cleanup the opts._workers array to keep things current.
This small addition to my code solves the issue for me.
And its necessary as greenlock-cluster/master.js creates an array of workers via the addWorker method (line #26). If those workers die or get killed externally for any reason then the attempt to broadcast to all of them on line #80 fails with ERR_IPC_CHANNEL_CLOSED.
FYI: as an optimization, it may be simpler to rely on the hash of active workers provided by the cluster module.
https://nodejs.org/dist/latest-v10.x/docs/api/cluster.html#cluster_cluster_workers
Otherwise, adding the code above to the documentation would be helpful to new users relying on this module.