Permalink
Browse files

fixed multiple mules event handling

  • Loading branch information...
1 parent b87a800 commit 527d371bdabacd3244a5ad7b6c4023390cfe5539 @unbit committed Mar 29, 2013
Showing with 3 additions and 1 deletion.
  1. +2 −0 core/mule.c
  2. +1 −1 core/signal.c
View
@@ -184,6 +184,7 @@ void uwsgi_mule_handler() {
if (interesting_fd == uwsgi.signal_socket || interesting_fd == uwsgi.my_signal_socket || farm_has_signaled(interesting_fd)) {
len = read(interesting_fd, &uwsgi_signal, 1);
if (len <= 0) {
+ if (len < 0 && (errno == EAGAIN || errno == EINTR || errno == EWOULDBLOCK)) continue;
uwsgi_log_verbose("uWSGI mule %d braying: my master died, i will follow him...\n", uwsgi.muleid);
end_me(0);
}
@@ -343,6 +344,7 @@ ssize_t uwsgi_mule_get_msg(int manage_signals, int manage_farms, char *message,
if (interesting_fd > -1) {
len = read(interesting_fd, &uwsgi_signal, 1);
if (len <= 0) {
+ if (len < 0 && (errno == EAGAIN || errno == EINTR || errno == EWOULDBLOCK)) goto clear;
uwsgi_log_verbose("uWSGI mule %d braying: my master died, i will follow him...\n", uwsgi.muleid);
end_me(0);
}
View
@@ -595,7 +595,7 @@ void uwsgi_receive_signal(int fd, char *name, int id) {
if (ret == 0) {
goto destroy;
}
- else if (ret < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
+ else if (ret < 0 && errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) {
uwsgi_error("[uwsgi-signal] read()");
goto destroy;
}

0 comments on commit 527d371

Please sign in to comment.