Return-Path: Delivered-To: apmail-geronimo-activemq-users-archive@www.apache.org Received: (qmail 32743 invoked from network); 28 Apr 2006 05:55:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Apr 2006 05:55:54 -0000 Received: (qmail 55586 invoked by uid 500); 28 Apr 2006 05:55:53 -0000 Delivered-To: apmail-geronimo-activemq-users-archive@geronimo.apache.org Received: (qmail 55571 invoked by uid 500); 28 Apr 2006 05:55:53 -0000 Mailing-List: contact activemq-users-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-users@geronimo.apache.org Delivered-To: mailing list activemq-users@geronimo.apache.org Received: (qmail 55562 invoked by uid 99); 28 Apr 2006 05:55:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2006 22:55:53 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=FORGED_HOTMAIL_RCVD2,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2006 22:55:52 -0700 Received: from localhost ([127.0.0.1] helo=talk.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1FZLwx-0002Q7-SB for activemq-users@geronimo.apache.org; Thu, 27 Apr 2006 22:55:31 -0700 Message-ID: <4135015.post@talk.nabble.com> Date: Thu, 27 Apr 2006 22:55:31 -0700 (PDT) From: Wayne1285 To: activemq-users@geronimo.apache.org Subject: Race Condition? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-Sender: WayneSIrwin@hotmail.com X-Nabble-From: Wayne1285 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I am using ActiveMq-4.0-RC3. I have been having intermittent problems getting sessions created and closed. I have downloaded the code and traced through it and I think I have found the problem. There is a race conditon in the TcpTransport class, in the doStart() method. As near as I can tell, as soon as the socket is created, the Broker responds with its WireFormatInfo. This information is usually stored as the remoteWireFormatInfo in the InactivityMonitor. The race condition occurs in the doStart() method as it appears the broker can sometimes send the wireFormatInfo before the initializeStreams() method can be called. This results in the information not being capture in the dataIn input buffer. Once this occurs, this sets up the session hangs that I have been experiencing. Since the remoteWireFormatInfo was never captured from the broker, requests to InactivityMonitor.startMonitorThreads() does not start as the condition of having a remoteWireFormatInfo is not met and the method just returns. That causes not socket activities at all. The original thread eventually proceeds to the WireFormatNegotiator.oneway(command) method that issues a readyCountDownLatch.await(); which is never met and never times out. I have written a thread to call the create session function and give it a maximum of 15 seconds to complete. If the thread exceeds that time, it is sent an interrupt, but that does not seem to interrupt the readyCountDownLatch.await(). Eventually I get all these hung threads that I cannot clean up. I would liike to see if the race conditon can be fixed, but in addition why I cannot issue an interrupt against this thread when it gets into this state. -- View this message in context: http://www.nabble.com/Race-Condition--t1522683.html#a4135015 Sent from the ActiveMQ - User forum at Nabble.com.