Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 29592 invoked from network); 5 Apr 2006 18:12:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Apr 2006 18:12:32 -0000 Received: (qmail 10892 invoked by uid 500); 5 Apr 2006 18:12:31 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 10866 invoked by uid 500); 5 Apr 2006 18:12:30 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 10857 invoked by uid 99); 5 Apr 2006 18:12:30 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Apr 2006 11:12:30 -0700 X-ASF-Spam-Status: No, hits=-8.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 05 Apr 2006 11:12:29 -0700 Received: (qmail 29310 invoked by uid 65534); 5 Apr 2006 18:12:08 -0000 Message-ID: <20060405181208.29309.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r391694 - /incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java Date: Wed, 05 Apr 2006 18:12:07 -0000 To: activemq-commits@geronimo.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: chirino Date: Wed Apr 5 11:12:05 2006 New Revision: 391694 URL: http://svn.apache.org/viewcvs?rev=391694&view=rev Log: fix for http://jira.activemq.org/jira/browse/AMQ-651 Modified: incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java Modified: incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java?rev=391694&r1=391693&r2=391694&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java (original) +++ incubator/activemq/trunk/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQEndpointWorker.java Wed Apr 5 11:12:05 2006 @@ -234,20 +234,27 @@ connection=null; } - synchronized private void reconnect(JMSException error){ + private void reconnect(JMSException error){ log.debug("Reconnect cause: ",error); - // Only log errors if the server is really down.. And not a temp failure. - if (reconnectDelay == MAX_RECONNECT_DELAY) { - log.info("Endpoint connection to JMS broker failed: " + error.getMessage()); - log.info("Endpoint will try to reconnect to the JMS broker in "+(MAX_RECONNECT_DELAY/1000)+" seconds"); + long reconnectDelay; + synchronized(this) { + reconnectDelay = this.reconnectDelay; + // Only log errors if the server is really down.. And not a temp failure. + if (reconnectDelay == MAX_RECONNECT_DELAY) { + log.info("Endpoint connection to JMS broker failed: " + error.getMessage()); + log.info("Endpoint will try to reconnect to the JMS broker in "+(MAX_RECONNECT_DELAY/1000)+" seconds"); + } } try { disconnect(); Thread.sleep(reconnectDelay); - // Use exponential rollback. - reconnectDelay*=2; - if (reconnectDelay > MAX_RECONNECT_DELAY) - reconnectDelay=MAX_RECONNECT_DELAY; + + synchronized(this) { + // Use exponential rollback. + this.reconnectDelay*=2; + if (this.reconnectDelay > MAX_RECONNECT_DELAY) + this.reconnectDelay=MAX_RECONNECT_DELAY; + } connect(); } catch(InterruptedException e) {} }