Permalink
Browse files

fixed signal handling in non-workers

  • Loading branch information...
1 parent 0791394 commit eeff935fc97f17130ec90d910f12df1d0d686206 @unbit committed Mar 29, 2013
Showing with 5 additions and 4 deletions.
  1. +1 −1 core/mule.c
  2. +2 −0 core/signal.c
  3. +0 −1 core/spooler.c
  4. +1 −1 plugins/psgi/psgi_plugin.c
  5. +1 −1 plugins/python/python_plugin.c
View
@@ -350,7 +350,7 @@ ssize_t uwsgi_mule_get_msg(int manage_signals, int manage_farms, char *message,
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;
View
@@ -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];
View
@@ -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 !!!
@@ -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)
@@ -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)

0 comments on commit eeff935

Please sign in to comment.