[rfc][icedtea-web] PR835: javaws findBestUrl leaks TCP connections

Adam Domurad adomurad at redhat.com
Thu Feb 7 14:58:48 PST 2013

On 02/07/2013 05:10 PM, Omair Majid wrote:
> On 02/07/2013 04:45 PM, Adam Domurad wrote:
>> Tiny patch here.
>> This issue still exists in head:
>> http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=835
>> The patch in the bug report works, although I have preferred the use of
>> a finally block (I prefer the stronger guarantee).
>> ChangeLog:
>> 2013-XX-XX  Adam Domurad  <adomurad at redhat.com>
>>      * netx/net/sourceforge/jnlp/cache/ResourceTracker.java
>>      (findBestUrl): Ensure that connections are not leaked.
> Looks okay to me.
> As an improvement, maybe we can avoid closing and return the "best"
> connection so it can be reused without having to establish another one.
> Cheers,
> Omair

Good idea. Luckily the code was set-up to make this fairly easy.

Due to rearranging the disconnect is placed slightly different (more 
aligned with the original patch).

Note that if connection == null, the NPE will get caught. I didn't have 
an idea of a better exception to throw, but I figured this should be 
noted (it had caused me pains before).

New ChangeLog.
2013-XX-XX Adam Domurad  <adomurad at redhat.com>

     PR835: Ensure connection do not leak.
     Additionally we avoid an unnecessary reconnect to the best URL
     * netx/net/sourceforge/jnlp/cache/ResourceTracker.java
     (initializeResourceConnection): New, replaces (findBestUrl). Returns
     chosen connection for re-usability. Sets resource download location.
     (initializeResource): Use new initializeResourceConnection, report
     if connection failed to be established.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR835+improvements.patch
Type: text/x-patch
Size: 3846 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20130207/5401e28b/PR835improvements.patch 

More information about the distro-pkg-dev mailing list