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/12/04 14:00:22 UTC

DO NOT REPLY [Bug 46337] New: real worker name is wrong

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

           Summary: real worker name is wrong
           Product: Tomcat Connectors
           Version: 1.2.27
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Common
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: mashmk02@gmail.com


Created an attachment (id=22988)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=22988)
patch for jk_lb_worker.c

I am using one lb worker with two sub workers. The name of sub workers are
'ajp13w' and 'ajp13w2'.
The format of the request log is as follows:
JkRequestLogFormat "%w(%R) %V %T"

When the failover occurred in mod_jk 1.2.22, the real worker name output to the
request log was 'ajp13w2'.
However, when the failover occurred in mod_jk 1.2.27, the real worker name was
'ajp13w'.

Because "s->route" is not NULL when the failover occurs, it is not overwrited
in a new worker name. 

jk_lb_worker.c
L1128
            if (!s->route)
                s->route = rec->route;

Log of mod_jk 1.2.22:
-----
[Thu Dec 04 13:33:29 2008] [25987:13664] [info]  init_jk::mod_jk.c (2743):
mod_jk/1.2.22 initialized
[Thu Dec 04 13:33:29 2008] [25988:13664] [info]  init_jk::mod_jk.c (2743):
mod_jk/1.2.22 initialized
[Thu Dec 04 13:34:04 2008] [25989:18752] [info] jk_open_socket::jk_connect.c
(451): connect to 172.20.140.5:8009 failed (errno=115)
[Thu Dec 04 13:34:04 2008] [25989:18752] [info]
ajp_connect_to_endpoint::jk_ajp_common.c (876): Failed opening socket to
(172.20.140.5:8009) (errno=115)
[Thu Dec 04 13:34:04 2008] [25989:18752] [info]
ajp_send_request::jk_ajp_common.c (1273): (ajp13w) error connecting to the
backend server (errno=115)
[Thu Dec 04 13:34:04 2008] [25989:18752] [info] ajp_service::jk_ajp_common.c
(1941): (ajp13w) sending request to tomcat failed,  recoverable operation
attempt=1
[Thu Dec 04 13:34:09 2008] [25989:18752] [info] jk_open_socket::jk_connect.c
(451): connect to 172.20.140.5:8009 failed (errno=115)
[Thu Dec 04 13:34:09 2008] [25989:18752] [info]
ajp_connect_to_endpoint::jk_ajp_common.c (876): Failed opening socket to
(172.20.140.5:8009) (errno=115)
[Thu Dec 04 13:34:09 2008] [25989:18752] [info]
ajp_send_request::jk_ajp_common.c (1273): (ajp13w) error connecting to the
backend server (errno=115)
[Thu Dec 04 13:34:09 2008] [25989:18752] [info] ajp_service::jk_ajp_common.c
(1941): (ajp13w) sending request to tomcat failed,  recoverable operation
attempt=2
[Thu Dec 04 13:34:09 2008] [25989:18752] [error] ajp_service::jk_ajp_common.c
(1953): (ajp13w) Connecting to tomcat failed. Tomcat is probably not started or
is listening on the wrong port
[Thu Dec 04 13:34:09 2008] [25989:18752] [info] service::jk_lb_worker.c (1098):
service failed, worker ajp13w is in error state
[Thu Dec 04 13:34:09 2008] wlb(ajp13w2) localhost 10.007632
---

Log of mod_jk 1.2.27:
-----
[Thu Dec 04 15:27:22.494 2008] [28187:161211744] [info] init_jk::mod_jk.c
(3020): mod_jk/1.2.27 initialized
[Thu Dec 04 15:27:22.509 2008] [28188:161211744] [info] init_jk::mod_jk.c
(3020): mod_jk/1.2.27 initialized
[Thu Dec 04 15:27:33.773 2008] [28190:1123916096] [info]
jk_open_socket::jk_connect.c (593): connect to 172.20.140.5:8009 failed
(errno=115)
[Thu Dec 04 15:27:33.773 2008] [28190:1123916096] [info]
ajp_connect_to_endpoint::jk_ajp_common.c (922): Failed opening socket to
(172.20.140.5:8009) (errno=115)
[Thu Dec 04 15:27:33.773 2008] [28190:1123916096] [error]
ajp_send_request::jk_ajp_common.c (1467): (ajp13w) connecting to backend
failed. Tomcat is probably not started or is listening on the wrong port
(errno=115)
[Thu Dec 04 15:27:33.773 2008] [28190:1123916096] [info]
ajp_service::jk_ajp_common.c (2407): (ajp13w) sending request to tomcat failed
(recoverable), because of error during request sending (attempt=1)
[Thu Dec 04 15:27:38.874 2008] [28190:1123916096] [info]
jk_open_socket::jk_connect.c (593): connect to 172.20.140.5:8009 failed
(errno=115)
[Thu Dec 04 15:27:38.875 2008] [28190:1123916096] [info]
ajp_connect_to_endpoint::jk_ajp_common.c (922): Failed opening socket to
(172.20.140.5:8009) (errno=115)
[Thu Dec 04 15:27:38.875 2008] [28190:1123916096] [error]
ajp_send_request::jk_ajp_common.c (1467): (ajp13w) connecting to backend
failed. Tomcat is probably not started or is listening on the wrong port
(errno=115)
[Thu Dec 04 15:27:38.875 2008] [28190:1123916096] [info]
ajp_service::jk_ajp_common.c (2407): (ajp13w) sending request to tomcat failed
(recoverable), because of error during request sending (attempt=2)
[Thu Dec 04 15:27:38.875 2008] [28190:1123916096] [error]
ajp_service::jk_ajp_common.c (2426): (ajp13w) connecting to tomcat failed.
[Thu Dec 04 15:27:38.875 2008] [28190:1123916096] [info]
service::jk_lb_worker.c (1347): service failed, worker ajp13w is in error state
[Thu Dec 04 15:27:38.878 2008] wlb(ajp13w) localhost 10.106069
---

regards.


-- 
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 46337] real worker name is wrong

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





--- Comment #1 from Rainer Jung <ra...@kippdata.de>  2008-12-04 06:39:26 PST ---
The route in the service struct is used for two purposes:

1) we send it via ajp12 and ajp13 to the backend
2) we set it in the load balancer and make it available for logging in Apache
httpd

Ad 1) Unfortunately route is never initialized before sending via AJP and
consistently it is never used in the Tomcat AJP connector. I think it would be
nice to actually set it to the route of the worker before sending to a backend,
and to allow the route contained in the session id to be injected by the
request and not only to be statically determined by jvmRoute in server.xml.

Ad 2) Here we need to decide consistently, whether we want to make the route
which was requested available, or the one we have actually chosen.


-- 
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 46337] real worker name is wrong

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

--- Comment #2 from Ryszard Łach <ry...@gmail.com> 2010-01-15 04:47:33 UTC ---
Hi.
First, thanks for excellent work. I'm using mod_jk for quite a long time...

I've just spent some time testing behaviour of retries directive of LB worker,
I was very confused finding in log file (format %w(%R)), that after retry the
request was served by the same worker, which's backend whasn't working.

Maybe the %R should be split in two directives, 1st for originally selected
worked and 2nd one for that, which finally served the request?

Best regards,

R.

-- 
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


[Bug 46337] route item in mod_jk bultin request log is wrong after failover

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

Rainer Jung <ra...@kippdata.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX
            Summary|real worker name is wrong   |route item in mod_jk bultin
                   |                            |request log is wrong after
                   |                            |failover

--- Comment #4 from Rainer Jung <ra...@kippdata.de> ---
After having again looked at the code I'm closing this as WONTFIX.
Please use the more powerful access log logging supported by mod_jk via Apache
logging notes. I think you get everything you are lokking for that way.

I have updated the docs to favor access log logging instead of the old-style
mod_jk request loging in the mod_jk log file.

Regards,

Rainer

-- 
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 46337] real worker name is wrong

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

--- Comment #3 from Rainer Jung <ra...@kippdata.de> 2010-01-15 05:22:27 UTC ---
(In reply to comment #2)
Please let us not discuss your idea here. It does not belong into this issue
and should be discussed on the tomcat users list.

One remark: mod_jk is able to log that information and much more as part of the
usual access log. The request logging inside the mod_jk error log might go away
some time, because the data is a much better fit for the access log. The
JkLogFile should only be used for error logging.

For information about how to include the info in the access log, learn about
LogFormat in

http://httpd.apache.org/docs/2.2/mod/mod_log_config.html

and look for "notes" in

http://tomcat.apache.org/connectors-doc/reference/apache.html

-- 
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