mirror of
https://github.com/nginx/nginx.git
synced 2025-06-06 00:42:40 +08:00
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).
This commit is contained in:
parent
0560ae55bc
commit
7f59728d5b
@ -681,6 +681,18 @@ ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
|
||||
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user