Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4306 - trunk/src/event/modules

Anonymous User
November 22, 2011 12:04PM
Author: mdounin
Date: 2011-11-22 17:02:21 +0000 (Tue, 22 Nov 2011)
New Revision: 4306

Log:
Protection from stale write events in epoll.

Stale write event may happen if epoll_wait() reported both read and write
events, and processing of the read event closed descriptor.

Patch by Yichun Zhang (agentzh).


Modified:
trunk/src/event/modules/ngx_epoll_module.c

Modified: trunk/src/event/modules/ngx_epoll_module.c
===================================================================
--- trunk/src/event/modules/ngx_epoll_module.c 2011-11-22 16:27:45 UTC (rev 4305)
+++ trunk/src/event/modules/ngx_epoll_module.c 2011-11-22 17:02:21 UTC (rev 4306)
@@ -681,6 +681,18 @@

wev = c->write;

+ 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 ((revents & EPOLLOUT) && wev->active) {

if (flags & NGX_POST_THREAD_EVENTS) {

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4306 - trunk/src/event/modules

Anonymous User 1208 November 22, 2011 12:04PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 156
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready