[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sam Berlin updated HTTPCLIENT-776:
----------------------------------

    Attachment: changes.txt

Attached is a testcase that reproduces the problem -- 
testAbortBeforeSocketCreate is throwing the NPE right now.  I'm really not 
positive how to fix it (but am still looking into it).   The basic problem is 
that you can abort the request before DefaultClientConnectionOperator creates 
the socket, which means that the socket isn't closed or marked as 
should-be-closed when the request is aborted.  This means that when after abort 
is called, openConnection still continues as normal & connects to the host, 
then it goes back to AbstractPoolEntry.open, where tracker is null & throws the 
NPE.

(I'm not marking the attachment as intended for inclusion, because there's 
still some more testcases, and hopefully some fixes, that I want to write.)

> NPE w/ AbstractPoolEntry.open
> -----------------------------
>
>                 Key: HTTPCLIENT-776
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-776
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.0 Alpha 4
>            Reporter: Sam Berlin
>         Attachments: changes.txt
>
>
> java.lang.NullPointerException
>     at 
> org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:171)
>     at 
> org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
>     at 
> org.apache.http.impl.client.DefaultClientRequestDirector.execute(DefaultClientRequestDirector.java:309)
>     at 
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:501)
>     at 
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:456)
>     at 
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:422)
>     at 
> com.limegroup.gnutella.http.DefaultHttpExecutor.performRequest(DefaultHttpExecutor.java:97)
>     at 
> com.limegroup.gnutella.http.DefaultHttpExecutor.access$000(DefaultHttpExecutor.java:26)
>     at 
> com.limegroup.gnutella.http.DefaultHttpExecutor$MultiRequestor.run(DefaultHttpExecutor.java:135)
>     at 
> org.limewire.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1006)
>     at 
> org.limewire.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:549)
>     at java.lang.Thread.run(Unknown Source)
> Seeing a lot of these against Alpha4.  Also seeing still the occassional 
> IllegalStateException of:
> java.lang.IllegalStateException: Connection already open.
>     at 
> org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:150)
>     at 
> org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
>     at 
> org.apache.http.impl.client.DefaultClientRequestDirector.execute(DefaultClientRequestDirector.java:309)
>     at 
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:501)
>     at 
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:456)
>     at 
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:422)
>     at 
> com.limegroup.gnutella.http.DefaultHttpExecutor.performRequest(DefaultHttpExecutor.java:97)
>     at 
> com.limegroup.gnutella.http.DefaultHttpExecutor.access$000(DefaultHttpExecutor.java:26)
>     at 
> com.limegroup.gnutella.http.DefaultHttpExecutor$MultiRequestor.run(DefaultHttpExecutor.java:135)
>     at 
> org.limewire.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1006)
>     at 
> org.limewire.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:549)
>     at java.lang.Thread.run(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to