Comments (8)
For reference, here's the relevant code which demonstrates what signals actually do...
@signal_handler.register('TERM') { stop_supervisor }
@signal_handler.register('INT') { stop(:stop_supervisor => true) }
@signal_handler.register('USR1') { restart }
@signal_handler.register('HUP') { reload_config }
from procodile.
For debugging, take a look at the procodile.log
which should show everything the supervisor is doing.
from procodile.
If you send a KILL
signal to procodile, it will just kill the supervisor immediately. You should be sending INT
to the procodile if you want it to shut down cleanly and stop its child processes too.
Edited to change TERM
to INT
. If you send the TERM
signal it only stops the supervisor. If you send INT
it stops everything.
from procodile.
Thanks @adamcooke, I'm talking about the following scenario:
-
I setup a Docker Container & run a bash session, ie:
docker exec -it xx_container_name_xx bash
which just starts an interactive bash terminal session. -
Then run Procodile -
procodile start
(without --dev/foreground mode, runs as daemon?), and can confirm the supervisor starts up with a PID and confirmed byps aux
. -
Then go to kill the bash session, by Ctrl+C (
TERM
), and it just sits there, doing nothing, doesn't disconnect from the bash session.
What is Interesting: - if I run a seperate bash session into the same Docker container, it will connect, and disconnect without any problems, whilst the other one still sits there?
Questions:
- Could it be one of the processes/workers holding it up?
- How can I debug what is happening behind the scenes on the
exit
/TERM
sig? - My understanding is that Ctrl+C sends the
TERM
signal?
from procodile.
If you send a TERM to bash, this will be propagated to its child processes (in this case the procodile supervisor). The supervisor will receive this and stop itself (but not its child processes). The processes that the supervisor started are started in a new process group so they won't receive any signals from upstream which means they'll likely continue indefinitely without any supervision.
Docker is possible just be waiting for all processes within the container to stop before actually stopping itself.
from procodile.
To answer your last question, CTRL+C usually sends the INT
signal.
from procodile.
Great thanks @adamcooke, so I've determined that if Procodile is running in the foreground (ie, I can see the log trails, using --dev
) then if I issue the Ctrl+C
command, it will shut down, but not if it's running in normal mode procodile start
without the --dev
flag?
from procodile.
A bit more investigation on this, it seems that running the way that the Docker container is initiated defines whether or not Procodile is cleanly shutdown when escaping using Ctrl+C
in a bash session:
from procodile.
Related Issues (20)
- Custom logger HOT 2
- Console/run commands and `--root` HOT 2
- When starting attempt to clean the pids directory before just failing to start
- Can you run this in production? HOT 5
- --dev ignores any per-process log file HOT 4
- Puma process/server didn't stops after procofile stop (production) or ctrl-c (--dev) HOT 2
- Procodile run returns TypeError HOT 1
- Running multiple applications with different roots HOT 1
- question : how to use env variable like $HOSTNAME HOT 1
- Wiki include a typo about Configuration page HOT 1
- I cannot see any options to split processes into production & development
- Setting listen interface to localhost
- Using procodile in Kubernetes Container
- Logging from web and worker is not working
- procodile --procfile Procfile.dev start not working, Error: Invalid command '--procfile' HOT 1
- [Question] Install from Gemfile?
- .env support?
- Planning create a fork use crystal-lang (Done!) HOT 2
- Can't stop the supervisor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from procodile.