Unitech / Unitech/pm2

My python file generate two child_process. When I run "pm2 start xxx.py",the program woks well. But when I close one child_process, another also paused.

Open
#5,528 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

What's going wrong?

My python file generate two child_process. When I run "pm2 start xxx.py",the program woks well. But when I close one child_process, pm2 will not reload the program. I just want to ask that could pm2 identify child_process and protect it when the program contains child_process?

How could we reproduce this issue?

import multiprocessing as mp

def fun1():
    while 1:
        print(11111)

def fun2():
    while 1:
        print(22222)

if __name__ == "__main__":
    read_process = mp.Process(target=fun1, args=())
    o_process = mp.Process(target=fun2, args=())
    read_process.start()
    o_process.start()

Supporting information

win 11
python 3.9

$ pm2 start test.py

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 by reproducing the Windows 11 case with Python 3.9 using the reported multiprocessing example and pm2 start test.py. Read the PM2 process-launch and child-process handling entry points to determine the current behavior; done means the issue has a documented or tested outcome for closing one child process while the other remains active.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, python
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.