benoitc / gunicorn

gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications.
http://www.gunicorn.org
Other
9.83k stars 1.75k forks source link

Exit status of master should be non-zero in case of error #1183

Closed jgehrcke closed 7 years ago

jgehrcke commented 8 years ago

Of course I am not 100 % sure about how this has been decided, but I would expect to see a non-zero exit code after master shutdown when a worker failed to boot. That is, this was highly surprising to me:

[...]
[2016-01-18 20:16:39 +0100] [8144] [INFO] Shutting down: Master
[2016-01-18 20:16:39 +0100] [8144] [INFO] Reason: Worker failed to boot.
(venv342-bouncer) [jp@jp-t450s:~/dev/bouncer]
20:16:39 $ echo $?
0
vespian commented 8 years ago

:+1:

tilgovi commented 8 years ago

:+1:

benoitc commented 8 years ago

Actually it is expected to return with exit status 3. Just tested it on zsh and It return what is expected:

[2016-05-02 15:50:57 +0200] [58904] [INFO] Worker exiting (pid: 58904)
[2016-05-02 15:50:57 +0200] [58901] [INFO] Shutting down: Master
[2016-05-02 15:50:57 +0200] [58901] [INFO] Reason: Worker failed to boot.
(gunicorn_py3)[examples] echo $?                                                           15:50:57  ☁  master ☂ ⚡ ✭
3

what shell are you using?

jgehrcke commented 8 years ago

Hey, using bash. But both of our shells should be working fine :-) (let's assume that for now, wouldn't it be horrible if my shell didn't properly expose the exit code of the process that last terminated?)

I think for making progress, we probably need to find the difference between our cases of making the worker fail. I unfortunately do not remember how I made it fail at the time of reporting.

One thing I also cannot exclude: maybe I had gunicorn running in a wrapper (shell script, for instance)? I doubt that, but as I have unfortunately not explicitly written that above, we shouldn't exclude this.

So, next time I can hopefully provide a more complete report.

benoitc commented 8 years ago

bump

benoitc commented 7 years ago

no answer since awhile. closing the issue since I was not able to reproduce it myself.