You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2008/09/08 22:06:04 UTC

DO NOT REPLY [Bug 45766] New: watchdog_interval issue in current svn version

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

           Summary: watchdog_interval issue in current svn version
           Product: Tomcat 6
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Connectors
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: zdenek@datacrunch.net


watchdog_interval can be set to number of seconds for watchdog thread. The code
seems to indicate that if default value is used (0) that maintenance happens in
HttpExtensionProc

        if (!watchdog_interval)
            wc_maintain(logger);


however

static DWORD WINAPI watchdog_thread(void *param)
{
    if (JK_IS_DEBUG_LEVEL(logger)) {
        jk_log(logger, JK_LOG_DEBUG,
               "Watchdog thread initialized");
    }
    while (is_inited) {
        Sleep(watchdog_interval * 1000);
        if (!is_inited)
            break;
        // debug
        if (JK_IS_DEBUG_LEVEL(logger)) {
            jk_log(logger, JK_LOG_DEBUG,
                   "Watchdog thread running");
        }
        wc_maintain(logger);
    }
    return 0;
}

starts anyway creating gigabytes of log if in debug. I modified the code to:

static DWORD WINAPI watchdog_thread(void *param)
{
    if (JK_IS_DEBUG_LEVEL(logger)) {
        jk_log(logger, JK_LOG_DEBUG,
               "Watchdog thread initialized");
    }
    // check if no watchdog
    if (watchdog_interval == 0) break;
    while (is_inited) {
        Sleep(watchdog_interval * 1000);
        if (!is_inited)
            break;
        // debug
        if (JK_IS_DEBUG_LEVEL(logger)) {
            jk_log(logger, JK_LOG_DEBUG,
                   "Watchdog thread running");
        }
        wc_maintain(logger);
    }
    return 0;
}

which resolves the issue. I believe that was the original intent not to start
the watchdog thread. Probably the best would be not to start the thread in the
first place, by modifying tail end of init_jk

    if (rc) {
        HANDLE wt;
        DWORD  wi;
        wt = CreateThread(NULL, 0, watchdog_thread, NULL, 0, &wi);
        jk_log(logger, JK_LOG_INFO, "%s initialized", (VERSION_STRING) );
    }
    return rc;
}


to 

    if ((rc) && (watchdog_interval)) {
        HANDLE wt;
        DWORD  wi;
        wt = CreateThread(NULL, 0, watchdog_thread, NULL, 0, &wi);
        jk_log(logger, JK_LOG_INFO, "%s initialized", (VERSION_STRING) );
    }
    return rc;

but i have not tested this change yet.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45766] watchdog_interval issue in current svn version

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





--- Comment #1 from zdenek <zd...@datacrunch.net>  2008-09-10 11:59:06 PST ---
I tested the modification of tail end of init_jk from:

    if (rc) {
        HANDLE wt;
        DWORD  wi;
        wt = CreateThread(NULL, 0, watchdog_thread, NULL, 0, &wi);
        jk_log(logger, JK_LOG_INFO, "%s initialized", (VERSION_STRING) );
    }
    return rc;
}


to:

    if ((rc) && (watchdog_interval)) {
        HANDLE wt;
        DWORD  wi;
        wt = CreateThread(NULL, 0, watchdog_thread, NULL, 0, &wi);
        jk_log(logger, JK_LOG_INFO, "%s initialized", (VERSION_STRING) );
    }
    return rc;

and it appears to work properly. Please review and update code if appropriate.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45766] watchdog_interval issue in current svn version

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


Mladen Turk <mt...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #2 from Mladen Turk <mt...@apache.org>  2008-09-10 22:48:09 PST ---
Patch applied. Thanks.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 45766] watchdog_interval issue in current svn version

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


zdenek <zd...@datacrunch.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows XP                  |Windows Server 2008
                   |                            |(Longhorn)




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org