From: SourceForge.net <no...@so...> - 2008-05-27 23:26:21
|
Bugs item #1940659, was opened at 2008-04-11 23:44 Message generated for change (Settings changed) made by breed You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1008544&aid=1940659&group_id=209147 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: java client Group: None >Status: Closed Resolution: Postponed Priority: 5 Private: No Submitted By: fpj (fpj) Assigned to: fpj (fpj) Summary: Client blocks for 3 minutes on call to socket() Initial Comment: On ClientCnxn.startConnect(), the client blocks for 3 minutes while trying to update the properties of the new socket through the following code: sock.socket().setSoLinger(false, -1); sock.socket().setTcpNoDelay(true); Through testing, I've been able to observe that the client blocks on the call to socket(), and that moving these two after the socket is connected seems to solve the problem. I'm providing a very small patch for this problem. I don't have a good explanation for why this is happening, though. ---------------------------------------------------------------------- Comment By: Benjamin Reed (breed) Date: 2008-04-18 09:49 Message: Logged In: YES user_id=154690 Originator: NO Good job figuring this out! Unfortunately this patches the code that isn't usually followed. Since we are non blocking, usually we go through the finishConnect() path, so the options would not be set correctly. The easiest thing to do might be to put the option setting into primeConnection. ---------------------------------------------------------------------- Comment By: fpj (fpj) Date: 2008-04-17 11:38 Message: Logged In: YES user_id=1926444 Originator: YES According to a post on the bug description, "The network code connects a socket to its own loopback interface..." during initialization, and blocking this connection through a firewall would cause a call to socket() to stall. However, a call to socket() after the call to connect() does not seem to block. I suspect that passing an IPv4 address to connect() eliminates the blocking problem if the firewall does not block IPv4 traffic, and the socket initializes correctly. -Flavio ---------------------------------------------------------------------- Comment By: fpj (fpj) Date: 2008-04-17 11:25 Message: Logged In: YES user_id=1926444 Originator: YES Link to bug report on a related problem: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6483406 -Flavio ---------------------------------------------------------------------- Comment By: fpj (fpj) Date: 2008-04-15 18:16 Message: Logged In: YES user_id=1926444 Originator: YES I'm attaching the output of jstack when the client hangs on socket, and it shows that some other object as a lock on the socket. -Flavio File Added: stack-trace.txt ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1008544&aid=1940659&group_id=209147 |