On 2002.02.27 08:43:34 -0700 Hannes Wallnöfer wrote:
> Thanks Jim. One problem I see with your solution is that it retries on 
> *every* exception, which is not what we want (or do we?). I'll give it a 
> try.


I'm not sure that there is sufficient information at this point to 
determine whether the write failed because of an expired keep-alive or for 
other reasons.  In a practical sense, once the system is running we see 
exceptions here only because of failed keep-alives.

Which leads into Dan's point
On 2002.02.27 08:31:58 -0700 Daniel Rall wrote:
> Interesting.  Submit a patch <http://jakarta.apache.org/site/source.html>
> with multiple retries (so a constant or something can be changed to
> configure the number of retries to attempt), and remove the early
> return.

The number of retries is exactly one if the cause of the failure is an 
expired keep-alive.  The system should not just quit becuase the 
keep-alive expired, but if the (single) retry doesn't succeed then the 
problem is not an expired keep-alive.

>  Also, I'm not especially familiar with the client code, but
> does this change belong in the XmlRpcClient super-class?

I have no idea - I don't use the XmlRpcClient directly, only the Lite so I 
don't know the behavior of the XmlRpcClient in this case.


Jim


> 
> 
> Jim Redman wrote:
> 
>> 
>> The code in the exception clause of:
>> 
>>         public void write (byte[] request) throws IOException
>> 
>> in XmlRpcClientLite does not seem to be effective in handling 
>> keep-alive timeouts.  The solution that works for me is to repeat the 
>> call to:
>> 
>>         Object execute (String method,
>>                 Vector params) throws XmlRpcException, IOException
>>         {
>> 
>> the code we've been using looks like this:
>> 
>>    public Object execute (String method, Vector params)
>>       throws XmlRpcException, IOException
>>     {
>>       try {
>>         return  executeInternal(method, params);
>>       } catch (Exception e) {
>>         System.err.println("Warning: Execute Internal (" + method + ") 
>> - " + e.getMessage() + " transient error - retrying");
>>       }
>> 
>>       // we'll give it two attempts, if it fails the first time it will
>>       // come here for a retry
>>       client =  null; // make sure
>>       return  executeInternal(method, params);
>>     }
>> 
>> 
>>     public Object executeInternal (String method, Vector params)   
>> <<<<----- the old execute method
>>      throws XmlRpcException, IOException
>>     {
>> 
>> Unless someone has a better solution, I'd like to get the code into the 
>> distro so that I don't have to modify future releases of the library.
>> 
>> Jim
>> 
> 
-- 

Jim Redman
(505) 662 5156
http://www.ergotech.com

Reply via email to