Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Cluster API: worker process can't get 'SIGTERM' signal when being killed #5766

Closed
@baoshan

Description

@baoshan
cluster = require "cluster"

if cluster.isMaster

  for i in [0...4]
    cluster.fork()

  setTimeout ->
    worker.kill() for id, worker of cluster.workers
  , 2000

else
  process.on 'SIGTERM', ->
    console.log 'SIGTERM'
  setTimeout (->), 100000

Outputs nothing. I think it should log SIGTERM 4 times.

What's wrong with the above code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions