Re: connections, deadlocks

On Thu, 27 Apr 2000, Corey Wineman wrote:

> Hello,
> 
> I am trying to use the HTTP client classes and am having a few problems. A
> few days ago a asked a question about deadlocks that happen when trying to
> get connections. Following someones' suggestion, I downloaded some newer
> versions and the problem seemed to go away. Now its back. Whenever I hit the
> point in HttpBasicServer.getConnection() where it has to wait for an
> available connection, it waits forever. What is causing this to happen? What
> is happening to my connections? Say I set the connection pool to one. Is
> there anything that I can do to make sure that the connection closes
> properly and can be reused? What is monitoring those connections and how
> does the monitor determine that a connection is okay to be reused?

We got a fix recently for another problem, apparently some JVM are not
implementing notify() as they should, and notifyAll() calls instead of
notify() were fixing a kind-of-deadlock problem, you may check with the
latest releases

> Also, I have a question that I think I know the answer to. When creating a
> Socket, is there anyway to control how long it will attempt to make a
> connection. If you try to create a socket to a bogus site, you will get a
> NoRouteToHostException( or something like that), but it takes several
> minutes for the exception to come up. Can you set a timeout for the initial
> connection? I believe the setTimeout only works a successful initial
> connection. My guess is that the answer is no. I think you have to try to
> make the connection in a separate thread and then put a timer on it.

Hum, in plain C it is easy to do (well relatively easy ;) ), but I don't
think it is possible in java, except with the heavy way you are
describing.
Regards,

      /\          - Yves Lafon - World Wide Web Consortium - 
  /\ /  \        Architecture Domain - Jigsaw Activity Leader
 /  \    \/\    
/    \   /  \   http://www.w3.org/People/Lafon - ylafon@w3.org    

Received on Monday, 29 May 2000 08:09:50 UTC