Hi,

the SMILA project uses HttpClient 4.1.2 and is very happy with it.

In order to improve system availability and reliability we did some tests on 
"what happens to the HTTP communication on disconnects" (e.g. a physical 
disconnect of the network cable).
As it is not possible to check beforehand if a connection is available and an 
operation is executable successfully we experimented with timeouts:

Using something like
client.getParams().setParameter(HttpConnectionParams.SO_TIMEOUT, 30000);
helps when reading data from a server response.

But what about writing to the server ? Checking the documentation and the code  
we could not find anything that addresses timeouts on write operations.
The current behavior on my machine (Ubuntu 10) is that the call blocks for 
about 15 minutes and then the following exception is thrown:

do_ypcall: clnt_call: RPC: Unable to send; errno = Network is unreachable
YPBINDPROC_DOMAIN: Domain not bound
java.net.UnknownHostException: <machine-name>
            at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
            at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:850)
            at 
java.net.InetAddress.getAddressFromNameService(InetAddress.java:1201)
            at java.net.InetAddress.getAllByName0(InetAddress.java:1154)
            at java.net.InetAddress.getAllByName(InetAddress.java:1084)
            at java.net.InetAddress.getAllByName(InetAddress.java:1020)
            at 
org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:242)
            at 
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:130)
            at 
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
            at 
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
            at 
org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:573)
            at 
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)
            at 
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
            at 
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
            at 
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
            at ...

Is there anything we can do to improve the situation with write operations ?
This is critical because HTTP communication consists always of write/read pairs 
(from the client perspective).

Bye,
Daniel

Reply via email to