Bug 52132

Summary: [PATCH] process activity score calculated incorrectly if time changes
Product: Apache httpd-2 Reporter: Flame <aphplix>
Component: mod_fcgidAssignee: Apache HTTPD Bugs Mailing List <bugs>
Severity: normal Keywords: MassUpdate, PatchAvailable
Priority: P2    
Version: 2.2.8   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: check for time going back

Description Flame 2011-11-03 23:15:02 UTC
Changing the system time by -1 hour caused the calculation of the process activity score to be incorrect. This prevented the spawning of new application processes for approx 1 hour.

FcgidTimeScore was set to default (1).
FcgidSpawnScoreUpLimit was set to default (10). 

Nov  3 19:42:58 server207-27 ntpd[5052]: synchronized to, stratum 2
Nov  3 18:42:58 server207-27 ntpd[5052]: time reset -3599.951366 s
Nov  3 18:42:58 server207-27 ntpd[5052]: kernel time sync enabled 0001

[Thu Nov 03 18:57:37 2011] [info] mod_fcgid: /index.php spawn score 2534 >= 10, skip the spawn request
[Thu Nov 03 18:57:38 2011] [info] mod_fcgid: /index.php spawn score 2533 >= 10, skip the spawn request

[Thu Nov 03 19:25:58 2011] [warn] mod_fcgid: can't apply process slot for /index.php
[Thu Nov 03 19:26:00 2011] [warn] mod_fcgid: can't apply process slot for /cometchat_receive.php
Comment 1 William A. Rowe Jr. 2012-01-19 17:34:45 UTC
This is to be expected if you are changing absolute time.  It causes havoc
on other time-sensitive apps and services as well.

If it happens due to a time zone change (local time) that is a defect.  Could
you clarify for us?
Comment 2 Michał Grzędzicki 2012-04-10 21:14:52 UTC
the logs suggest absolute time change the code in

    /* Decrease the score based on elapsed time */
    current_node->score -=
        sconf->time_score *
        (int)(apr_time_sec(now) - apr_time_sec(current_node->last_stat_time));

    /* Make score reasonable */
    if (current_node->score < 0)
        current_node->score = 0;

    current_node->last_stat_time = now;

mod_fcgid can easly check for time going backward, this function Isn't used very often so I think it won't have any impact on performance
Comment 3 Michał Grzędzicki 2012-04-10 21:16:07 UTC
Created attachment 28573 [details]
check for time going back
Comment 4 William A. Rowe Jr. 2018-11-07 21:10:02 UTC
Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd.

As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd.

If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question.

If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with.

Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated.