Bug 58504

Summary: Maintenance process skipped occasionally
Product: Tomcat Connectors Reporter: Hiroto Shimizu <shimizuhiroto123>
Component: mod_jkAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 1.2.41   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: patch against trunk

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.