https://issues.apache.org/bugzilla/show_bug.cgi?id=52056
             Bug #: 52056
           Summary: Wrong HTTP status 200 in log instead of 500/503
           Product: Tomcat Connectors
           Version: 1.2.32
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_jk
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: aven...@dmz.org.ua
    Classification: Unclassified


Created attachment 27818
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=27818
default value for request_rec.status

In case JkLogFormat contains "%s" (Request HTTP status) placeholder - it is not
always shows correct codes.
If there are no workers available - mod_jk records 200 (HTTP_OK) in logs, while
httpd records and shows 503 error:

<<access.log:
172.16.16.1 - - [19/Oct/2011:10:35:01 +0300] "GET / HTTP/1.1" 503 323

<<mod_jk.log:
[Wed Oct 19 10:35:01.906 2011] [2053:3086162528] [error]
ajp_send_request::jk_ajp_common.c (1630): (devel) connecting to backend failed.
Tomcat is probably not started or is listening on the wrong port (errno=111)    
[Wed Oct 19 10:35:01.906 2011] [2053:3086162528] [error]
ajp_send_request::jk_ajp_common.c (1630): (devel) connecting to backend failed.
Tomcat is probably not started or is listening on the wrong port (errno=111)    
[Wed Oct 19 10:35:01.906 2011] [2053:3086162528] [error]
ajp_service::jk_ajp_common.c (2626): (devel) connecting to tomcat failed.

[Wed Oct 19 10:35:01.906 2011] 0.100435 - vm201.int GET / HTTP/1.1 200

[Wed Oct 19 10:35:01.906 2011] [2053:3086162528] [info] jk_handler::mod_jk.c
(2678): Service error=-3 for worker=devel

It seems that request.status (the one that got recorded in logs) have default
value of 200 and is updated only in jk_ajp_common.c::ajp_get_reply(). But this
function never hit if jk_ajp_common.c::ajp_send_request() returns anything
besides JK_TRUE. 
Maybe request.status variable should be initialized the same way as is_error
variable in jk_handler() - default value HTTP_INTERNAL_SERVER_ERROR, and all
subsequent  functions will alter its value to one they needed. With such
modification mod_jk will put 500 error in case request failed before it have a
chance to connect to backend (see attachment).

-- 
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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to