1
0
mirror of https://github.com/openresty/openresty synced 2024-11-14 08:45:50 +01:00
openresty/patches/nginx-1.1.15-epoll_check_stale_wev.patch
2012-02-20 15:52:22 +08:00

21 lines
776 B
Diff

--- nginx-1.1.15/src/event/modules/ngx_epoll_module.c 2011-09-30 22:12:53.000000000 +0800
+++ nginx-1.1.15-patched/src/event/modules/ngx_epoll_module.c 2011-11-30 11:08:46.775817019 +0800
@@ -682,6 +682,17 @@
wev = c->write;
if ((revents & EPOLLOUT) && wev->active) {
+ if (c->fd == -1 || wev->instance != instance) {
+
+ /*
+ * the stale event from a file descriptor
+ * that was just closed in this iteration
+ */
+
+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
+ "epoll: stale event %p", c);
+ continue;
+ }
if (flags & NGX_POST_THREAD_EVENTS) {
wev->posted_ready = 1;