Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EED9AD5D5 for ; Mon, 20 Aug 2012 23:00:01 +0000 (UTC) Received: (qmail 26222 invoked by uid 500); 20 Aug 2012 23:00:01 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 26189 invoked by uid 500); 20 Aug 2012 23:00:01 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 26182 invoked by uid 99); 20 Aug 2012 23:00:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2012 23:00:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2012 23:00:00 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 912FD23888E4 for ; Mon, 20 Aug 2012 22:59:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1375295 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp: Connection.cs Transport/Failover/FailoverTransport.cs Date: Mon, 20 Aug 2012 22:59:17 -0000 To: commits@activemq.apache.org From: jgomes@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120820225917.912FD23888E4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jgomes Date: Mon Aug 20 22:59:17 2012 New Revision: 1375295 URL: http://svn.apache.org/viewvc?rev=1375295&view=rev Log: Reimplement fix for zombie consumers to update the failover state tracker. Fixes https://issues.apache.org/jira/browse/AMQNET-394 Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Connection.cs activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/Failover/FailoverTransport.cs Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Connection.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Connection.cs?rev=1375295&r1=1375294&r2=1375295&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Connection.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Connection.cs Mon Aug 20 22:59:17 2012 @@ -907,8 +907,7 @@ namespace Apache.NMS.ActiveMQ } } - Tracer.ErrorFormat("Connection[{0}]: No such consumer active: {1}. Removing...", this.ConnectionId, dispatch.ConsumerId); - transport.Oneway(new RemoveInfo() { ObjectId = dispatch.ConsumerId }); + Tracer.ErrorFormat("Connection[{0}]: No such consumer active: {1}", this.ConnectionId, dispatch.ConsumerId); } protected void OnKeepAliveCommand(ITransport commandTransport, KeepAliveInfo info) Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/Failover/FailoverTransport.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/Failover/FailoverTransport.cs?rev=1375295&r1=1375294&r2=1375295&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/Failover/FailoverTransport.cs (original) +++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/branches/1.5.x/src/main/csharp/Transport/Failover/FailoverTransport.cs Mon Aug 20 22:59:17 2012 @@ -563,7 +563,8 @@ namespace Apache.NMS.ActiveMQ.Transport. return; } else if(command.IsRemoveInfo || command.IsMessageAck) - { + { + stateTracker.Track(command); // Simulate response to RemoveInfo command or a MessageAck // since it would be stale at this point. if(command.ResponseRequired) @@ -596,23 +597,23 @@ namespace Apache.NMS.ActiveMQ.Transport. // Wait for transport to be connected. ITransport transport = ConnectedTransport; DateTime start = DateTime.Now; - bool timedout = false; + bool timedout = false; while(transport == null && !disposed && connectionFailure == null) { Tracer.Info("Waiting for transport to reconnect."); int elapsed = (int) (DateTime.Now - start).TotalMilliseconds; - if(this.timeout > 0 && elapsed > timeout) + if(this.timeout > 0 && elapsed > this.timeout) { timedout = true; Tracer.DebugFormat("FailoverTransport.oneway - timed out after {0} mills", elapsed); break; - } - + } + // Release so that the reconnect task can run try { - // Wait for something + // Wait for something. The mutex will be pulsed if we connect. Monitor.Wait(reconnectMutex, 100); } catch(ThreadInterruptedException e)