hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: HttpClient 4, I/O exception and
Date Fri, 06 Jun 2008 10:59:51 GMT
On Fri, 2008-06-06 at 11:57 +0200, Martin Zdila wrote:
> Oleg,
> 
> > > > > SocketInputStream.socketRead0(FileDescriptor, byte[], int, int, int)
> > > > > line: not available [native method] [local variables unavailable]
> > > >
> > > > The thread is blocked in the socket read operation. This is perfectly
> > > > normal. If you do not want the operation to block indefinitely you
> > > > should set a timeout for it.
> > >
> > > But that read operation never ends even if the remote http server is
> > > normally responsive.
> >
> > The client gets blocked in a _native_ method managed by the JVM. It is
> > entirely out of HttpClient control. If the method does not return, that
> > means that the server is not sending any data.
> 
> That's not truth. The HttpClient is responsible for reading from socket and it 
> seems it violence the HTTP protocol as it is reading from the remote HTTP 
> server that is not in the state to output any data to the client.
> 

Feel free to point what requirement of the HTTP spec HttpClient is not
compliant with.


> > > So I think there is bug in HTTP client. I'll try to prepare a testcase
> >
> > Sure thing.
> 
> Attached. Enjoy! :-)
> 

Is this a pissing contest for you or something? If so, I have neither
time nor inclination to participate.

You test case works for me. 

Удачи и все дела

Олег

Executing GET
[DEBUG] ClientParamsStack - 'http.protocol.max-redirects': null
[DEBUG] ClientParamsStack - 'http.route.forced-route': null
[DEBUG] ClientParamsStack - 'http.route.local-address': null
[DEBUG] ClientParamsStack - 'http.route.default-proxy': null
[DEBUG] ClientParamsStack - 'http.conn-manager.timeout': null
[DEBUG] ThreadSafeClientConnManager -
ThreadSafeClientConnManager.getConnection:
HttpRoute[{}->http://www.zdila.sk], timeout = 0
[DEBUG] ConnPoolByRoute - No free connections
[HttpRoute[{}->http://www.zdila.sk]][null]
[DEBUG] ConnPoolByRoute - Available capacity: 20
[HttpRoute[{}->http://www.zdila.sk]][null]
[DEBUG] ConnPoolByRoute - Creating new connection
[HttpRoute[{}->http://www.zdila.sk]]
[DEBUG] ClientParamsStack - 'http.connection.stalecheck': null
[DEBUG] DefaultClientRequestDirector - Stale connection check
[DEBUG] DefaultClientRequestDirector - Stale connection detected
[DEBUG] DefaultClientConnection - Connection closed
[DEBUG] ClientParamsStack - 'http.connection.timeout': null
[DEBUG] ClientParamsStack - 'http.tcp.nodelay': null
[DEBUG] ClientParamsStack - 'http.socket.timeout': null
[DEBUG] ClientParamsStack - 'http.socket.linger': null
[DEBUG] ClientParamsStack - 'http.socket.buffer-size': null
[DEBUG] ClientParamsStack - 'http.protocol.element-charset': null
[DEBUG] ClientParamsStack - 'http.connection.max-line-length': null
[DEBUG] ClientParamsStack - 'http.protocol.element-charset': null
[DEBUG] ClientParamsStack - 'http.connection.max-header-count': null
[DEBUG] ClientParamsStack - 'http.connection.max-line-length': null
[DEBUG] ClientParamsStack - 'http.connection.max-status-line-garbage':
null
[DEBUG] ClientParamsStack - 'http.virtual-host': null
[DEBUG] ClientParamsStack - 'http.default-headers': null
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] ClientParamsStack - 'http.useragent': null
[DEBUG] ClientParamsStack - 'http.protocol.cookie-policy': null
[DEBUG] RequestAddCookies - CookieSpec selected: best-match
[DEBUG] ClientParamsStack - 'http.protocol.cookie-datepatterns': null
[DEBUG] ClientParamsStack - 'http.protocol.single-cookie-header': null
[DEBUG] DefaultClientRequestDirector - Attempt 1 to execute request
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] wire - >> "POST /post.html HTTP/1.1[EOL]"
[DEBUG] wire - >> "Content-Length: 0[EOL]"
[DEBUG] wire - >> "Host: www.zdila.sk[EOL]"
[DEBUG] wire - >> "Connection: Keep-Alive[EOL]"
[DEBUG] wire - >> "[EOL]"
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] headers - >> POST /post.html HTTP/1.1
[DEBUG] headers - >> Content-Length: 0
[DEBUG] headers - >> Host: www.zdila.sk
[DEBUG] headers - >> Connection: Keep-Alive
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] wire - << "HTTP/1.1 200 OK[EOL]"
[DEBUG] wire - << "Date: Fri, 06 Jun 2008 10:55:06 GMT[EOL]"
[DEBUG] wire - << "Server: Apache/2.0.59 (Unix) mod_ssl/2.0.59
OpenSSL/0.9.8d DAV/2 PHP/5.1.6[EOL]"
[DEBUG] wire - << "Last-Modified: Wed, 04 Jun 2008 07:01:53 GMT[EOL]"
[DEBUG] wire - << "ETag: "1e91b-d3-cdb27a40"[EOL]"
[DEBUG] wire - << "Accept-Ranges: bytes[EOL]"
[DEBUG] wire - << "Content-Length: 211[EOL]"
[DEBUG] wire - << "Content-Type: text/html[EOL]"
[DEBUG] wire - << "Via: 1.1 vdcrmag2-proxy.orange.ch:3128[EOL]"
[DEBUG] wire - << "Connection: close[EOL]"
[DEBUG] headers - << HTTP/1.1 200 OK
[DEBUG] headers - << Date: Fri, 06 Jun 2008 10:55:06 GMT
[DEBUG] headers - << Server: Apache/2.0.59 (Unix) mod_ssl/2.0.59
OpenSSL/0.9.8d DAV/2 PHP/5.1.6
[DEBUG] headers - << Last-Modified: Wed, 04 Jun 2008 07:01:53 GMT
[DEBUG] headers - << ETag: "1e91b-d3-cdb27a40"
[DEBUG] headers - << Accept-Ranges: bytes
[DEBUG] headers - << Content-Length: 211
[DEBUG] headers - << Content-Type: text/html
[DEBUG] headers - << Via: 1.1 vdcrmag2-proxy.orange.ch:3128
[DEBUG] headers - << Connection: close
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] ClientParamsStack - 'http.protocol.handle-redirects': false
[DEBUG] ClientParamsStack - 'http.protocol.handle-authentication': false
[DEBUG] ThreadSafeClientConnManager - Released connection open but not
marked reusable.
[DEBUG] DefaultClientConnection - Connection shut down
[DEBUG] ConnPoolByRoute - Freeing connection
[HttpRoute[{}->http://www.zdila.sk]][null]
[DEBUG] ConnPoolByRoute - Notifying no-one, there are no waiting threads
Waiting 60 seconds
Continuing with POST
[DEBUG] ClientParamsStack - 'http.protocol.max-redirects': null
[DEBUG] ClientParamsStack - 'http.route.forced-route': null
[DEBUG] ClientParamsStack - 'http.route.local-address': null
[DEBUG] ClientParamsStack - 'http.route.default-proxy': null
[DEBUG] ClientParamsStack - 'http.conn-manager.timeout': null
[DEBUG] ThreadSafeClientConnManager -
ThreadSafeClientConnManager.getConnection:
HttpRoute[{}->http://www.zdila.sk], timeout = 0
[DEBUG] ConnPoolByRoute - No free connections
[HttpRoute[{}->http://www.zdila.sk]][null]
[DEBUG] ConnPoolByRoute - Available capacity: 20
[HttpRoute[{}->http://www.zdila.sk]][null]
[DEBUG] ConnPoolByRoute - Creating new connection
[HttpRoute[{}->http://www.zdila.sk]]
[DEBUG] ClientParamsStack - 'http.connection.stalecheck': null
[DEBUG] DefaultClientRequestDirector - Stale connection check
[DEBUG] DefaultClientRequestDirector - Stale connection detected
[DEBUG] DefaultClientConnection - Connection closed
[DEBUG] ClientParamsStack - 'http.connection.timeout': null
[DEBUG] ClientParamsStack - 'http.tcp.nodelay': null
[DEBUG] ClientParamsStack - 'http.socket.timeout': null
[DEBUG] ClientParamsStack - 'http.socket.linger': null
[DEBUG] ClientParamsStack - 'http.socket.buffer-size': null
[DEBUG] ClientParamsStack - 'http.protocol.element-charset': null
[DEBUG] ClientParamsStack - 'http.connection.max-line-length': null
[DEBUG] ClientParamsStack - 'http.protocol.element-charset': null
[DEBUG] ClientParamsStack - 'http.connection.max-header-count': null
[DEBUG] ClientParamsStack - 'http.connection.max-line-length': null
[DEBUG] ClientParamsStack - 'http.connection.max-status-line-garbage':
null
[DEBUG] ClientParamsStack - 'http.virtual-host': null
[DEBUG] ClientParamsStack - 'http.default-headers': null
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] ClientParamsStack - 'http.useragent': null
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] ClientParamsStack - 'http.protocol.expect-continue': null
[DEBUG] ClientParamsStack - 'http.protocol.cookie-policy': null
[DEBUG] RequestAddCookies - CookieSpec selected: best-match
[DEBUG] ClientParamsStack - 'http.protocol.cookie-datepatterns': null
[DEBUG] ClientParamsStack - 'http.protocol.single-cookie-header': null
[DEBUG] DefaultClientRequestDirector - Attempt 1 to execute request
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] wire - >> "POST /post.html HTTP/1.1[EOL]"
[DEBUG] wire - >> "Content-Length: 13[EOL]"
[DEBUG] wire - >> "Host: www.zdila.sk[EOL]"
[DEBUG] wire - >> "Connection: Keep-Alive[EOL]"
[DEBUG] wire - >> "[EOL]"
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] headers - >> POST /post.html HTTP/1.1
[DEBUG] headers - >> Content-Length: 13
[DEBUG] headers - >> Host: www.zdila.sk
[DEBUG] headers - >> Connection: Keep-Alive
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] wire - >> "submit=submit"
[DEBUG] wire - << "HTTP/1.1 200 OK[EOL]"
[DEBUG] wire - << "Date: Fri, 06 Jun 2008 10:56:10 GMT[EOL]"
[DEBUG] wire - << "Server: Apache/2.0.59 (Unix) mod_ssl/2.0.59
OpenSSL/0.9.8d DAV/2 PHP/5.1.6[EOL]"
[DEBUG] wire - << "Last-Modified: Wed, 04 Jun 2008 07:01:53 GMT[EOL]"
[DEBUG] wire - << "ETag: "1e91b-d3-cdb27a40"[EOL]"
[DEBUG] wire - << "Accept-Ranges: bytes[EOL]"
[DEBUG] wire - << "Content-Length: 211[EOL]"
[DEBUG] wire - << "Content-Type: text/html[EOL]"
[DEBUG] wire - << "Via: 1.1 vdcrmag2-proxy.orange.ch:3128[EOL]"
[DEBUG] wire - << "Connection: close[EOL]"
[DEBUG] headers - << HTTP/1.1 200 OK
[DEBUG] headers - << Date: Fri, 06 Jun 2008 10:56:10 GMT
[DEBUG] headers - << Server: Apache/2.0.59 (Unix) mod_ssl/2.0.59
OpenSSL/0.9.8d DAV/2 PHP/5.1.6
[DEBUG] headers - << Last-Modified: Wed, 04 Jun 2008 07:01:53 GMT
[DEBUG] headers - << ETag: "1e91b-d3-cdb27a40"
[DEBUG] headers - << Accept-Ranges: bytes
[DEBUG] headers - << Content-Length: 211
[DEBUG] headers - << Content-Type: text/html
[DEBUG] headers - << Via: 1.1 vdcrmag2-proxy.orange.ch:3128
[DEBUG] headers - << Connection: close
[DEBUG] ClientParamsStack - 'http.protocol.version': HTTP/1.1
[DEBUG] ClientParamsStack - 'http.protocol.handle-redirects': false
Finished.
[DEBUG] ClientParamsStack - 'http.protocol.handle-authentication': false
[DEBUG] ThreadSafeClientConnManager - Released connection open but not
marked reusable.
[DEBUG] DefaultClientConnection - Connection shut down
[DEBUG] ConnPoolByRoute - Freeing connection
[HttpRoute[{}->http://www.zdila.sk]][null]
[DEBUG] ConnPoolByRoute - Notifying no-one, there are no waiting threads



> BR
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message