circus-tent/circus

Reaping process casting stop command to the whole watcher.

Opened this issue · 1 comments

We are running one watcher with 3 instances of the process. 2 of the instances exits and circusd needs to reexecute them.

Everything is fine, but for some reason, "stop" command to the whole watcher is sent and it kills 3rd process in runtime.

Here is some logs of the circusd:
Check line: "[DEBUG] got message b'{"command":"stop","msg_type":"cast","properties":{"name":"marshroutizathor"}}'"

2021-02-13 12:50:07 circus[1] [DEBUG] reaping process 115 [Marshroutizathor]
2021-02-13 12:50:07 circus[1] [DEBUG] reaping process 116 [Marshroutizathor]
2021-02-13 12:50:07 circus[1] [DEBUG] cmd: php ./public/index.php appcell-bridge mr
2021-02-13 12:50:07 circus[1] [DEBUG] args: 
2021-02-13 12:50:07 circus[1] [DEBUG] process args: ['php', './public/index.php', 'appcell-bridge', 'mr']
2021-02-13 12:50:07 circus[1] [DEBUG] running Marshroutizathor process [pid 131]
2021-02-13 12:50:07 circus[1] [DEBUG] got message b'{"command":"stop","msg_type":"cast","properties":{"name":"marshroutizathor"}}'
2021-02-13 12:50:07 circus[1] [DEBUG] the command conflicts with running manage_watchers, re-executing it at the end
2021-02-13 12:50:07 circus[1] [DEBUG] cmd: php ./public/index.php appcell-bridge mr
2021-02-13 12:50:07 circus[1] [DEBUG] args: 
2021-02-13 12:50:07 circus[1] [DEBUG] process args: ['php', './public/index.php', 'appcell-bridge', 'mr']
2021-02-13 12:50:07 circus[1] [DEBUG] running Marshroutizathor process [pid 132]
2021-02-13 12:50:07 circus[1] [DEBUG] stopping the Marshroutizathor watcher
2021-02-13 12:50:07 circus[1] [DEBUG] gracefully stopping processes [Marshroutizathor] for 30.0s
2021-02-13 12:50:07 circus[1] [DEBUG] Marshroutizathor: kill process 110
2021-02-13 12:50:07 circus[1] [DEBUG] sending signal Signals.SIGTERM to 110
2021-02-13 12:50:07 circus[1] [DEBUG] Marshroutizathor: kill process 131
2021-02-13 12:50:07 circus[1] [DEBUG] sending signal Signals.SIGTERM to 131
2021-02-13 12:50:07 circus[1] [DEBUG] Marshroutizathor: kill process 132
2021-02-13 12:50:07 circus[1] [DEBUG] sending signal Signals.SIGTERM to 132
2021-02-13 12:50:07 circus[1] [DEBUG] reaping already dead process 110 [Marshroutizathor]
2021-02-13 12:50:07 circus[1] [DEBUG] reaping already dead process 131 [Marshroutizathor]
2021-02-13 12:50:07 circus[1] [DEBUG] reaping already dead process 132 [Marshroutizathor]
2021-02-13 12:50:07 circus[1] [INFO] Marshroutizathor stopped
2021-02-13 12:50:07 circus[1] [DEBUG] got message b'{"command":"stop","msg_type":"cast","properties":{"name":"marshroutizathor"}}'
2021-02-13 12:50:14 circus[1] [DEBUG] got message b'{"command":"start","msg_type":"cast","properties":{"name":"marshroutizathor"}}'
2021-02-13 12:50:14 circus[1] [DEBUG] cmd: php ./public/index.php appcell-bridge mr
2021-02-13 12:50:14 circus[1] [DEBUG] args: 
2021-02-13 12:50:14 circus[1] [DEBUG] process args: ['php', './public/index.php', 'appcell-bridge', 'mr']
2021-02-13 12:50:14 circus[1] [DEBUG] running Marshroutizathor process [pid 134]
2021-02-13 12:50:14 circus[1] [DEBUG] cmd: php ./public/index.php appcell-bridge mr
2021-02-13 12:50:14 circus[1] [DEBUG] args: 
2021-02-13 12:50:14 circus[1] [DEBUG] process args: ['php', './public/index.php', 'appcell-bridge', 'mr']
2021-02-13 12:50:14 circus[1] [DEBUG] running Marshroutizathor process [pid 135]
2021-02-13 12:50:14 circus[1] [DEBUG] cmd: php ./public/index.php appcell-bridge mr
2021-02-13 12:50:14 circus[1] [DEBUG] args: 
2021-02-13 12:50:14 circus[1] [DEBUG] process args: ['php', './public/index.php', 'appcell-bridge', 'mr']
2021-02-13 12:50:14 circus[1] [DEBUG] running Marshroutizathor process [pid 136]
2021-02-13 12:50:14 circus[1] [INFO] Marshroutizathor started
2021-02-13 12:50:14 circus[1] [DEBUG] got message b'{"command":"start","msg_type":"cast","properties":{"name":"marshroutizathor"}}'
2021-02-13T12:50:14+01:00 INFO (6): Preparing Marshroutizathor queue
2021-02-13T12:50:14+01:00 INFO (6): Preparing Marshroutizathor queue
2021-02-13T12:50:14+01:00 INFO (6): Preparing Marshroutizathor queue

This is our configuration of the watcher:

[watcher:Marshroutizathor]
cmd = php ./public/index.php appcell-bridge mr
numprocesses = 3
use_sockets = True
copy_env = True
max_retry = -1

We are experience the same issue with version 0.17.1.