You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2021/07/22 16:10:02 UTC

svn commit: r1891727 - /httpd/httpd/trunk/server/mpm/event/event.c

Author: ylavic
Date: Thu Jul 22 16:10:02 2021
New Revision: 1891727

URL: http://svn.apache.org/viewvc?rev=1891727&view=rev
Log:
mpm_event: avoid possible timer off by 250 ms.

* server/mpm/event/event.c (listener_thread): EVENT_FUDGE_FACTOR is used to
  limit wakeups but still expiring timers should be compared with the real
  apr_time_now().

Similar to r1874277 for TIMEOUT_FUDGE_FACTOR.

Modified:
    httpd/httpd/trunk/server/mpm/event/event.c

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1891727&r1=1891726&r2=1891727&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Thu Jul 22 16:10:02 2021
@@ -1934,10 +1934,10 @@ static void * APR_THREAD_FUNC listener_t
          * the maximum time to poll() below, if any.
          */
         expiry = timers_next_expiry;
-        if (expiry && expiry < now + EVENT_FUDGE_FACTOR) {
+        if (expiry && expiry < now) {
             apr_thread_mutex_lock(g_timer_skiplist_mtx);
             while ((te = apr_skiplist_peek(timer_skiplist))) {
-                if (te->when > now + EVENT_FUDGE_FACTOR) {
+                if (te->when > now) {
                     timers_next_expiry = te->when;
                     timeout = te->when - now;
                     break;