[ 
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

The attached patch should fix the problems, plus adds a few new tests (two of 
which would have failed before).

Basically I captured the 'shutdown' event in DefaultClientConnection and 
prevent opening(..) from completely succesfully if the connection was shutdown 
prior to an opening announcement.  Also in AbstractPoolEntry we check for 
'tracker' becoming null and fail after the operator connects if tracker became 
null.  With respect to AbstractPoolEntry, it's not completely clear that a side 
effect of 'resetTrackedRoute' will prevent open(..) from completing, so I added 
it to the javadoc.  A better way would be renaming it to something like 
shutdownEntry().   It was previously called 'closing' (before 
resetTrackedRoute), meaning it was notification that something external was 
being shutdown... but it's kind of active itself, given that there's an 
open(..) method that can be aborted due to it.

(I'd check this in, but haven't gotten any notifications about an account setup 
yet. Sorry!)

> 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
>             Fix For: 4.0 Alpha 5 
>
>         Attachments: changes.txt, 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