tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 40792] New: - 500 error from Tomcat causes modjk lb worker to consider tomcat unusable for timeout period
Date Wed, 18 Oct 2006 23:57:36 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40792>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40792

           Summary: 500 error from Tomcat causes modjk lb worker to consider
                    tomcat unusable for timeout period
           Product: Tomcat 5
           Version: 5.5.15
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Native:JK
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: ken@i2rd.com


It seems that there is a bug in the error handling code in the lb worker.

I was using a modjk/tomcat configuration with a lb worker and two ajp13 workers.
One of the ajp13 workers was marked disabled and stopped.  The other tomcat
worker returned a 500 HTTP response for one user of the system.  This caused the
following log messages from modjk code:

[Mon Oct 16 13:39:16 2006] [info] ajp_process_callback::jk_ajp_common.c (1375):
Connection aborted or network problems
[Mon Oct 16 13:39:16 2006] [info] ajp_service::jk_ajp_common.c (1719): Receiving
from tomcat failed, because of client error without recovery
 in send loop 0
[Mon Oct 16 13:39:16 2006] [info] service::jk_lb_worker.c (677): unrecoverable
error 400, request failed. Client failed in the middle of requ
est, we can't recover to another instance.
[Mon Oct 16 13:39:16 2006] [info] jk_handler::mod_jk.c (1970): Aborting
connection for worker=lb

The error caused other users at the time to receive 503 error from apache
because modjk considered no workers to be OK. After awhile (about 1 minute)
modjk recognized that the Tomcat worker was ok and started working again.

In looking at the code, it appears that the problem might be that the worker's
busy flag is not cleared in this snippet of code:

(from jk_lb_worker.c: line 666 revision 1.89)
else if (service_stat == JK_CLIENT_ERROR) {
  /*
   * Clent error !!!
   * Since this is bad request do not fail over.
   */
  rec->s->errors++;
  rec->s->in_error_state = JK_FALSE;
  rec->s->in_recovering = JK_FALSE;
  rec->s->error_time = 0;
  *is_error = is_service_error;

  jk_log(l, JK_LOG_INFO,
       "unrecoverable error %d, request failed."
       " Client failed in the middle of request,"
                           " we can't recover to another instance.",
                           is_service_error);
       JK_TRACE_EXIT(l);
       return JK_CLIENT_ERROR;
 }

The JK_WORKER_IN_ERROR and JK_WORKER_USABLE macros check the is_busy flag so it
seems that not clearing it could cause a problem.

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

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


Mime
View raw message