unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.46k stars 691 forks source link

Legion cron does not pass exit codes #838

Open nevins-b opened 9 years ago

nevins-b commented 9 years ago

when running uwsgi with following configuration the uwsgi process does not unlord itself when the cron task fails:

[uwsgi]
legion = test 127.0.0.1:8081 100 bf-cbc:test
cron2 = minute=-1,unique=1,legion=test exit 1
legion-death-on-lord-error = 300

Log:

[uWSGI] getting INI configuration from l1.ini
*** Starting uWSGI 2.0.9 (64bit) on [Thu Feb 12 14:42:18 2015] ***
compiled with version: 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54) on 12 February 2015 14:37:02
os: Darwin-14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22 23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64
nodename: MBP-JINN.local
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /Users/nbartolomeo/Code/venv/order_service
detected binary path: /Users/nbartolomeo/Code/venv/order_service/bin/uwsgi
your processes number limit is 709
your memory page size is 4096 bytes
detected max file descriptor number: 4864
lock engine: OSX spinlocks
thunder lock: disabled (you can enable it with --thunder-lock)
Python version: 2.7.6 (default, Sep  9 2014, 15:04:36)  [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x7fb54b515bc0
your mercy for graceful operations on workers is 60 seconds
[uwsgi-cron] command "exit 1" registered as cron task for legion "test"
*** Operational MODE: no-workers ***
spawned uWSGI master process (pid: 88276)
legion manager thread enabled
[uwsgi-legion] --- WE HAVE QUORUM FOR LEGION test !!! (valor: 100 uuid: E39B84EE-9D31-4449-9BF4-72B4A47045B2 checksum: 2116 votes: 1) ---
[uwsgi-legion] --- END OF QUORUM REPORT ---
[uwsgi-legion] attempting to become the Lord of the Legion test
[uwsgi-legion] i am now the Lord of the Legion test
Thu Feb 12 14:42:24 2015 - [uwsgi-cron] running "exit 1" (pid 88285)
[uwsgi-cron] command "exit 1" running with pid 88285 exited after 1 second(s)
unbit commented 9 years ago

This is not how --legion-death-on-lord-error works, it is triggered when the lord/unlord actions fail. It is unrelated to cron.

If i understand correctly, you want an instance to not be a lord anymore if one of its cron fail, right ?

nevins-b commented 9 years ago

that is correct, I guess I expected the legion cron to work like a hook normally would in legion mode.