tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jorge Medina" <>
Subject mod_jk : recovery_options
Date Fri, 27 Mar 2009 20:15:32 GMT

  I have an automated test of a web services application running on
Tomcat (6.0.18) behind Apache (2.2.11) We use mod_jk (1.2.27)
  Our test suite runs a client against the Apache server on a system
where we have a single Tomcat instance behind Apache. 
So far so good, all test passed.

  Now, I tried using Apache as a load balancer; using two Tomcat
instances behind Apache. 
  All of my tests passed, except for one that failed on a strange way.

  The test does the following:
	 createItem (A)
	 createItem (B)
       createItem (C)
       list = getAllItems()
  at this point we verify that we get 3 items on the list, but instead
of 3, the list returned 4 items!!

  This was the only test that failed from a test suite of about 400. I
ran the same test suite again and the error did not occur again. 
  So, could it be related to the configuration of the mod_jk module in

  Currently we don't specify the "recovery_options" for the Tomcat
worker (therefore it defaults to "0") in
  We do not specify the "retries" either, so it defaults to "2".

  I was wondering if in the test above, a "createItem" call was resent
to a Tomcat instance due to some communication error, and therefore 4
items were created in the database instead of the 3 we expected. 

  I would appreciate if someone could shed more light on the
"recovery_options" from what it is found in the documentation.

  Below is what I found on the documentation

Thanks a lot.


Worker Type: AJP,SUB	
Default value:  0	 

Recovery options influence, how we should handle retries, in case we
detect a problem with Tomcat. How often we will retry is controlled by
the attribute retries. 

This attribute is a bit mask. The following bits are allowed:
1: don't recover if Tomcat failed after getting the request
2: don't recover if Tomcat failed after sending the headers to client
4: close the connection to Tomcat, if we detect an error when writing
back the answer to the client (browser)
8: always recover requests for HTTP method HEAD (even if Bits 1 or 2 are
16: always recover requests for HTTP method GET (even if Bits 1 or 2 are

This features has been added in jk 1.2.6. Option 4 has been added in
version 1.2.16, options 8 and 16 in version 1.2.24. 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message