hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Ludwig <sfmission...@yahoo.com>
Subject Re: HttpClient seems to hang on SocketNativeIO.read
Date Wed, 14 Dec 2005 19:24:19 GMT
Roland,

Thanks for the response. I'd been searching the
archives for a bit, and discovered a couple of things:

1. I set the "Connection: close" header. That seemed
to help.
2. I set the linger value to 4000. That also seemed to
help. Right now, I'm not seeing any stuck download
threads...but the day is young!

Best,

George







--- Roland Weber <http-async@dubioso.net> wrote:

> Hello George,
> 
> it looks like your message somehow fell through the
> cracks.
> Sorry for the late response.
> 
> > "ThreadPool-Crawler DownloadJob
> > PooledThread-1-running" id=436 idx=0x62
> > tid=-1569055552 prio=5 alive, in native, daemon
> > at jrockit/net/SocketNativeIO.read(IIII)I(Native
> Method)
> > at
>
jrockit/net/SocketNativeIO.read(Ljava/io/FileDescriptor;III)I(Unknown
> Source)[inlined]
> > at java/net/AbstractSocketImpl$1.read(II)I(Unknown
> Source)[optimized]
> > ^-- Holding lock:
> > java/net/AbstractSocketImpl$1@0x5e481fd0[thin
> lock]
> > at
> jrockit/io/NativeIOInputStream.read(I[BI)I(Unknown
> Source)[inlined]
> > at
> jrockit/io/NativeIOInputStream.read([BII)I(Unknown
> Source)[optimized]
> > at
>
java/io/BufferedInputStream.fill()V(BufferedInputStream.java:218)[inlined]
> > [...]
> > My socket timeout is set to 54 seconds, so I don't
> > understand why these sockets go off into space for
> > many hours, never to come back.
> 
> Well, your sockets seem to be jrockit specific ones.
> Maybe there is a bug in the socket implementation?
> Depending on the Java version, HttpClient implements
> some
> socket timeouts by spawning a timout thread which
> eventually
> interrupts the blocked thread after the timeout. If
> jrockit
> sockets do not unblock the thread in that case,
> there is the
> explanation. With JDK 1.4, the timeout is set at the
> socket
> itself.
> 
> I suggest you enable HttpClient logging. In your
> case, you
> probably don't need the wire log to understand what
> is
> going on.
> 
> hope that helps,
>   Roland
> 
> 
> > 
> > Here's my HttpClient initialization code:
> > 
> > static { 
> >   HttpConnectionManagerParams connMgrParams = 
> >     new HttpConnectionManagerParams();
> >   connMgrParams.setConnectionTimeout(4000);
> >   connMgrParams.setSoTimeout(4000);
> >   connMgrParams.setMaxConnectionsPerHost(
> >     HostConfiguration.ANY_HOST_CONFIGURATION,1);
> >   connMgrParams.setMaxTotalConnections(300);
> >   MultiThreadedHttpConnectionManager connMgr = 
> >     new MultiThreadedHttpConnectionManager();
> >   connMgr.setParams(connMgrParams);
> >   httpClient= new HttpClient(connMgr);
> > }
> > 
> > I also noticed in the jrockit memory leak tool
> that
> > even though I set ignoreCookies to be true before
> > every call, I still acumulate thousands of then.
> Is
> > this normal?
> > 
> > Cheers,
> > 
> > George
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> httpclient-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> httpclient-user-help@jakarta.apache.org
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> httpclient-user-help@jakarta.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message