Re: Relieving some ClassLoader contention in PreferredClassProvider

Dan Creswell <[email protected]>
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
Peter Jones wrote:
> On Thu, Jan 04, 2007 at 04:56:41PM -0600, Gregg Wonderly wrote:
>> Peter Jones wrote:
>>
>>> Just to be clear, is the network activity that you are concerned about
>>> only the name->address resolution done by SocketPermission.implies
>>> during PreferredClassProvider.createClassLoader?  Or is it also the
>>> resolution potentially done by URL.equals during the table lookup and
>>> the "boomerang" search (PreferredClassProvider.findOriginLoader)?
>> I am interested in acceptable behavior in both cases.  The
>> .implies() is one thing that causes all URLs to be queried (one
>> optimization I added was to check for an HttpURLConnection instance
>> and request a "HEAD" instead of "GET").  A non operating codebase
>> host, will hang all threads for at least the TCP timeout period
>> foreach URL.openConnection() at least.  So, I am really concerned
>> overall about minimizing the impact any particular failure has on
>> unrelated threads.
>
> Wait, are you suggesting that an actual HTTP request is attempted
> during the process of getting the permission for each codebase URL?
> That is certainly not expected (or desired), so if it is indeed
> happening for you, then something is wrong and we need to figure out
> why (and I wonder if it is the high order cause of the problems that
> you have been seeing).  Despite its name, invoking URL.openConnection
> (or invoking getPermission on the returned URLConnection) is not
> supposed to actually make an HTTP connection (see the main class doc
> for URLConnection-- only connect() and other methods that require a
> connection to be made should do so).  So the procedure done by
> PreferredClassLoader.addPermissionsForURLs should not cause any HTTP
> connections to the codebase URLs-- only perhaps host name->address
> resolution because of what SocketPermission.implies does.
>

I certainly recall investigating a codebase issue where I wandered
through addPermissionsForURLs() and discovered the name resolution
hehaviour.  Can't recall it opening connections tho' (but my
recollection is vague).

Dan.

> -- Peter
>
> --------------------------------------------------------------------------
> Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
> Community Web Site:  http://jini.org
> jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
> Unsubscribing:       email "signoff JINI-USERS"  to [email protected]
>

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.