Thanks for the advise on this. It works well. -Adrian On Sun, May 3, 2009 at 12:14 AM, Adrian Cole <[email protected]>wrote:
> I have a project: jclouds which uses the following version of httpnio: > <dependency> > <groupId>org.apache.httpcomponents</groupId> > <artifactId>httpcore-nio</artifactId> > <version>4.0</version> > </dependency> > > I have a connection > pool<http://code.google.com/p/jclouds/source/browse/trunk/extensions/httpnio/src/main/java/org/jclouds/http/httpnio/pool/HttpNioFutureCommandConnectionPool.java> > which > implements > EventListener<http://hc.apache.org/httpcomponents-core/httpcore-nio/apidocs/org/apache/http/nio/protocol/EventListener.html#fatalIOException(java.io.IOException,%20org.apache.http.nio.NHttpConnection)>. > Now, this application is mainly used to connect to Amazon S3. I often get > IOExceptions like below for connection reset by peer. However, they are > coming in as fatalIOException. This seems to imply a complete shutdown of > the IOReactor. My first impression is this is too severe, as re-creating an > IOReactor over a connection reset seems a bit harsh. However this is the > current behaviour. Do you have any ideas on how I can work around > connection resets in a simple way? > > Best regards, > > Adrian Cole > > Here are some details: > > http://code.google.com/p/jclouds/issues/detail?id=14 > > SEVERE: [closed]-31222126{s3.amazonaws.com/72.21.202.112:80} - io error > java.io.IOException: Connection reset by peer > at sun.nio.ch.FileDispatcher.read0(Native Method) > at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21) > at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233) > at sun.nio.ch.IOUtil.read(IOUtil.java:206) > at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236) > at > org.apache.http.impl.nio.reactor.SessionInputBufferImpl.fill(SessionInputBufferImpl.java:94) > at > org.apache.http.impl.nio.codecs.AbstractMessageParser.fillBuffer(AbstractMessageParser.java:127) > at > org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:156) > at > org.apache.http.impl.nio.DefaultClientIOEventDispatch.inputReady(DefaultClientIOEventDispatch.java:146) > at > org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:153) > at > org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:314) > at > org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:294) > at > org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:256) > at > org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:96) > at > org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:556) > at java.lang.Thread.run(Thread.java:619) > >
