fixed signal handling in non-workers

This commit is contained in:
Unbit
2013-03-29 12:50:56 +01:00
parent 0791394f1a
commit eeff935fc9
5 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -350,7 +350,7 @@ next:
uwsgi_log_verbose("master sent signal %d to mule %d\n", uwsgi_signal, uwsgi.muleid);
#endif
if (uwsgi_signal_handler(uwsgi_signal)) {
uwsgi_log_verbose("error managing signal %d on mule %d\n", uwsgi_signal, uwsgi.mywid);
uwsgi_log_verbose("error managing signal %d on mule %d\n", uwsgi_signal, uwsgi.muleid);
}
// set the error condition
len = -1;
+2
View File
@@ -6,6 +6,8 @@ int uwsgi_signal_handler(uint8_t sig) {
struct uwsgi_signal_entry *use = NULL;
uwsgi_log("WID = %d\n", uwsgi.mywid);
int pos = (uwsgi.mywid * 256) + sig;
use = &uwsgi.shared->signal_table[pos];
-1
View File
@@ -108,7 +108,6 @@ pid_t spooler_start(struct uwsgi_spooler * uspool) {
signal(SIGSTOP, SIG_IGN);
signal(SIGTSTP, SIG_IGN);
uwsgi.mywid = -1;
uwsgi.mypid = getpid();
uspool->pid = uwsgi.mypid;
// avoid race conditions !!!
+1 -1
View File
@@ -668,7 +668,7 @@ void uwsgi_perl_run_hook(SV *hook) {
}
static void uwsgi_perl_atexit() {
if (uwsgi.mywid == -1) goto realstuff;
if (uwsgi.mywid == 0) goto realstuff;
// if hijacked do not run atexit hooks
if (uwsgi.workers[uwsgi.mywid].hijacked)
+1 -1
View File
@@ -290,7 +290,7 @@ void uwsgi_python_reset_random_seed() {
void uwsgi_python_atexit() {
if (uwsgi.mywid == -1) goto realstuff;
if (uwsgi.mywid == 0) goto realstuff;
// if hijacked do not run atexit hooks
if (uwsgi.workers[uwsgi.mywid].hijacked)