Commit b0d9c063 authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1762580, r1762701, r1762702, r1762718, r1762723, r1762742, r1762743,...

Merge r1762580, r1762701, r1762702, r1762718, r1762723, r1762742, r1762743, r1774538, r1779354 from trunk:

event: use atomics for *timeout_queue->total since it's updated concurrently,
and move TO_QUEUE_*() macros to functions.


event: add/remove from/to the pollset outside of the critical sections.

We don't need external locking since it's created with APR_POLLSET_THREADSAFE,
hence reduce those sections to the lowest cycles possible.

A spinlock may be interesting instead of the mutex now, we won't block and the
TO_QUEUE_*() and process_timeout_queue() operations are fast...



event: follow up to r1762701: update log tag.

event: avoid unnecessary listener/polling wake ups (context switches) by using
apr_pollset_wakeup(), when implemented, to signal the listener according to the
next timers or timeout queues expiry (updated at insert and maintenance time).



Follow up to r1762718: CHANGES entry.

event: follow up to r1762718.
We still need to kill kept-alive connections in normal/expiry processing if
the workers are busy or dying.



event: follow up to r1762718 and r1762742: put de condition where it belongs.



event: follow up to r1762718.

On graceful shutdown/restart, kill kept-alive connections before poll()ing
again, avoiding to wait for their "normal" timers (before being woken up)
when they remain the last handled connections.



event: follow up to r1762701.
Keep QUEUE_APPEND()+pollset_add() or QUEUE_REMOVE()+pollset_remove() atomic.

Otherwise when a worker adds an entry in some queue (e.g. KA, lingering), it
might race with the listener in the time between the mutex is released and the
pollset is updated; meanwhile the listener might process the queue and find an
entry no yet in its pollset.

For the lingering queue, the entry could then have been used after its pool
destroyed.

Submitted by: ylavic
Reviewed by: ylavic, icing, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1802146 13f79535-47bb-0310-9956-ffa450edef68
parent ca6bf55c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@

Changes with Apache 2.4.28

  *) event: Avoid listener periodic wake ups by using the pollset wake-ability
     when available.  PR 57399.  [Yann Ylavic, Luca Toscano]

  *) mod_proxy_wstunnel: Fix detection of unresponded request which could have
     led to spurious HTTP 502 error messages sent on upgrade connections.
     PR 61283.  [Yann Ylavic]
+0 −13
Original line number Diff line number Diff line
@@ -116,19 +116,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  *) event: Avoid listener periodic wake ups by using the pollset wake-ability
     when available.  PR 57399.
     trunk patch: http://svn.apache.org/r1762580
                  http://svn.apache.org/r1762701
                  http://svn.apache.org/r1762702
                  http://svn.apache.org/r1762718
                  http://svn.apache.org/r1762723
                  http://svn.apache.org/r1762742
                  http://svn.apache.org/r1762743
                  http://svn.apache.org/r1774538
                  http://svn.apache.org/r1779354
     2.4.x patch: http://home.apache.org/~ylavic/patches/httpd-2.4.x-mpm_event-wakeup-v7.1.patch
     +1: ylavic, icing, jim

PATCHES PROPOSED TO BACKPORT FROM TRUNK:
  [ New proposals should be added at the end of the list ]
+286 −162

File changed.

Preview size limit exceeded, changes collapsed.