Bug 58504 - Maintenance process skipped occasionally
Summary: Maintenance process skipped occasionally
Status: RESOLVED FIXED
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: mod_jk (show other bugs)
Version: 1.2.41
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-19 07:40 UTC by Hiroto Shimizu
Modified: 2016-09-16 08:42 UTC (History)
0 users



Attachments
patch against trunk (389 bytes, patch)
2015-10-19 07:40 UTC, Hiroto Shimizu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hiroto Shimizu 2015-10-19 07:40:03 UTC
Created attachment 33186 [details]
patch against trunk

When the following environment set, maintenance process skipped occasionally.
This behavior is 1.2.41 only.
 * worker.maintain=30
 * JkWatchdogInterval  30

I analyze of follows.
In case of JK_TRUE, maintenance is performed in maintain_workers().

if "jk_shmem.hdr-> h.data.maintain_time = trigger", JK_FALSE is returned.
But it should be returned JK_TRUE.

---jk_shm.c
    872 int jk_shm_check_maintain(time_t trigger)
    :
    881     if (jk_shmem.hdr->h.data.maintain_time < trigger) {
    882         jk_shmem.hdr->h.data.maintain_time = time(NULL);
    883         rv = JK_TRUE;
    884     }
    :
    886     return rv;
---

I made patch against trunk.

======================================
--- jk_shm.c    (revision 1702073)
+++ jk_shm.c    (working copy)
@@ -878,7 +878,7 @@
         JK_ATOMIC_DECREMENT(&(jk_shmem.hdr->h.data.maintain_checking));
         return rv;
     }
-    if (jk_shmem.hdr->h.data.maintain_time < trigger) {
+    if (jk_shmem.hdr->h.data.maintain_time <= trigger) {
         jk_shmem.hdr->h.data.maintain_time = time(NULL);
         rv = JK_TRUE;
     }
Comment 1 Mark Thomas 2016-09-16 08:42:39 UTC
Thanks for the analysis and the patch. The patch has been applied to trunk and will be included in 1.2.42 onwards.