You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tremolo's process manager doesn't have many features, yet resilience was the goal.
At the time this document was written, Tremolo is the only* ASGI server implementation that handlesSIGKILL cleanly. You can try the following:
1. Run the ASGI server with 2 workers
python-mtremolo--port8000--worker-num2example:app
2. Find out the running PIDs based on the output
Tremolo main (pid 30120) is running
[2025-02-15 13:20:15] Tremolo (ASGI) worker (pid 30121) is started at 127.0.0.1 port 8000
[2025-02-15 13:20:15] Tremolo (ASGI) worker (pid 30122) is started at 127.0.0.1 port 8000
Or check with pidof python3 || pidof python, then usually the main PID is rightmost in the output:
30122 30121 30120
3. Try to stop the main PID with SIGKILL
kill -9 30120
4. Now, what do you expect?
When running pidof python3 || pidof python again, we should see nothing. And this is how it happens in Tremolo.
*) In another implementations that I tested, they kept the child processes alive.
30122 30121
IMO this would make it a bit unpredictable.
Here is a summary table of how processes in Tremolo react to signals:
Signal
Tremolo (main)
Tremolo (worker)
SIGINT (Ctrl-C or kill -2)
Shutdown all children as well
Shutdown only this worker; main exits when no workers are alive
SIGTERM (kill -15 or just kill)
Shutdown all children as well
Shutdown only this worker; main exits when no workers are alive
documentationImprovements or additions to documentation
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Tremolo's process manager doesn't have many features, yet resilience was the goal.
At the time this document was written, Tremolo is the only* ASGI server implementation that handles SIGKILL cleanly. You can try the following:
1. Run the ASGI server with 2 workers
2. Find out the running PIDs based on the output
Or check with
pidof python3 || pidof python, then usually the main PID is rightmost in the output:3. Try to stop the main PID with SIGKILL
4. Now, what do you expect?
When running
pidof python3 || pidof pythonagain, we should see nothing. And this is how it happens in Tremolo.*) In another implementations that I tested, they kept the child processes alive.
IMO this would make it a bit unpredictable.
Here is a summary table of how processes in Tremolo react to signals:
Ctrl-Corkill -2)kill -15or justkill)kill -9)Beta Was this translation helpful? Give feedback.
All reactions