[
https://issues.apache.org/jira/browse/HTTPCLIENT-1228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13446113#comment-13446113
]
Dennis Ju edited comment on HTTPCLIENT-1228 at 9/1/12 3:39 AM:
---------------------------------------------------------------
I reformatted the code so it's more legible. Every iteration is creating new
instances.
Here's a sample output of what I get on OS X 10.8. The last line "Connect to
slow.website.com:80 timed out" shows that the request blocked instead of
immediately aborting.
Request already aborted
Request already aborted
Connection has been shut down
Socket closed
Socket closed
Connection has been shut down
Socket closed
Socket closed
Socket closed
Connect to slow.website.com:80 timed out
was (Author: dennisju):
I reformatted the code so it's more legible. Every iteration is creating
new instances.
Here's a sample output of what I get on OS X 10.8. The last line "Connect to
slow.website.com:80 timed out" shows that the request blocked instead of
immediately aborting.
Connection has been shut down
Socket closed
Socket closed
Connection has been shut down
Socket closed
Socket closed
Socket closed
Connect to slow.website.com:80 timed out
> HttpGet.abort() / HttpPost.abort() doesn't always abort immediately
> -------------------------------------------------------------------
>
> Key: HTTPCLIENT-1228
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1228
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.2.1
> Reporter: Dennis Ju
> Priority: Minor
> Attachments: TestAbort.java
>
>
> HttpGet.abort() and HttpPost.abort() don't always abort immediately. It works
> most of the time, but occasionally the connection will block until it times
> out. I noticed this only happens when I explicitly set a timeout value
> (HttpConnectionParams.setConnectionTimeout()).
> According to HttpComponent docs, "When an HTTP request is aborted its
> execution thread blocked in an I/O operation is guaranteed to unblock by
> throwing a InterruptedIOException".
> The attached test code should demonstrate the issue. Every once in awhile,
> you'll get "Connect to slow.website.com:80 timed out".
> I'm running Mac OS X 10.8 (Java version 1.6.0_29).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]