You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2014/12/19 16:42:31 UTC

[Bug 57374] New: Event MPM: Wrong KeepAliveTimeout when system clock is put back

https://issues.apache.org/bugzilla/show_bug.cgi?id=57374

            Bug ID: 57374
           Summary: Event MPM: Wrong KeepAliveTimeout when system clock is
                    put back
           Product: Apache httpd-2
           Version: 2.4.10
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mpm_event
          Assignee: bugs@httpd.apache.org
          Reporter: apache-bugzilla@michael-kaufmann.ch

The KeepAliveTimeout is calculated incorrectly after the system clock has been
put back. This is probably a bug in the event MPM, because it does not happen
with the worker MPM.

How to reproduce this bug:
* build Apache httpd 2.4.10 with ./configure --with-mpm=event
--enable-mpms-shared="event worker" [....]
* start httpd and send this request (e.g. with telnet):
GET / HTTP/1.1
HOST: test

* Apache closes the connection after 5 seconds (as expected)
* Change the system time:
sudo date -s "-1hour"
* Send a new request. Now Apache does NOT close the connection after 5 seconds.
I assume that the keep-alive timeout is 5 seconds + 1 hour.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57374] Event MPM: Wrong KeepAliveTimeout when system clock is put back

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57374

--- Comment #1 from Michael Kaufmann <ap...@michael-kaufmann.ch> ---
The bug is probably in event.c / listener_thread():

===
now = apr_time_now();
/* we only do this once per 0.1s (TIMEOUT_FUDGE_FACTOR) */
if (now > timeout_time) {
    struct process_score *ps;
    timeout_time = now + TIMEOUT_FUDGE_FACTOR;
    ....
===

timeout_time contains a wrong value after the system time has changed (the
value is relative to the old system time).

Measuring time intervals with apr_time_now() or gettimeofday() is a bad idea,
see here:
http://blog.habets.pp.se/2010/09/gettimeofday-should-never-be-used-to-measure-time

Unfortunately, there is no function in APR that corresponds to
clock_gettime(CLOCK_MONOTONIC, ...).

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 57374] Event MPM: Wrong KeepAliveTimeout when system clock is put back

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57374

nada <ap...@valgronda.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |apache_bugzilla@valgronda.c
                   |                            |om

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org