Unitech / Unitech/pm2

Add an option to change and remove the stop signal send interval

Open
#3,398 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P4: Low T: Enhancement
Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

When you run a pm2 stop or pm2 delete, the process will try to send a SIGINT signal every 100ms, this is hard-coded here:

https://github.com/Unitech/pm2/blob/70199f47f239b0ddb59a73bdc61a692cd4681b43/lib/God/Methods.js#L163-L172

This interval should be optional (only one signal send and then wait) and configurable, has for the kill timeout option on the ecosystem.json file.

For my concrete case, I want the process to finish his job properly before quit. There are some sub-processes at the end of my script that can't handle the SIGINT.

There is absolutely no need for me to send a bunch of signals.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/God/Methods.js at the linked stop-signal interval around lines 163-172, then inspect how the kill timeout option is configured in ecosystem.json. Add the requested configurable interval and verify that pm2 stop and pm2 delete can send one signal and wait, or use the configured interval.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.