godaddy / node-cluster-service

Turn your single process code into a fault-resilient, multi-process service with built-in REST & CLI support. Restart or hot upgrade your web servers with zero downtime or impact to clients.

Home Page:https://www.npmjs.org/package/cluster-service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLI blocks communication (*Nix only)

asilvas opened this issue · comments

"readline" interface blocks the master process on *nix...

Work around this by either moving the input interface to a child process (not visible to other worker processes to keep it clean), or somehow fix the blocking prompts somehow...

Not a bug of cluster-service, but rather readline.createInterface blocks indefinitely if you run the service in the background:

cservice worker.js &

No way to auto-detect if run as background process found, so must manually disable cli if you wish to run as background:

cservice worker.js --cliEnabled false &

If you leverage cserviced, it'll disable the cli for you automatically.

cserviced worker.js