Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 32024 invoked from network); 10 Apr 2006 20:41:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Apr 2006 20:41:36 -0000 Received: (qmail 29930 invoked by uid 500); 10 Apr 2006 20:41:36 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 29903 invoked by uid 500); 10 Apr 2006 20:41:35 -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 29894 invoked by uid 99); 10 Apr 2006 20:41:35 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2006 13:41:35 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,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; Mon, 10 Apr 2006 13:41:35 -0700 Received: (qmail 31360 invoked by uid 65534); 10 Apr 2006 20:41:15 -0000 Message-ID: <20060410204115.31359.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r393054 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java Date: Mon, 10 Apr 2006 20:41:14 -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: Mon Apr 10 13:41:13 2006 New Revision: 393054 URL: http://svn.apache.org/viewcvs?rev=393054&view=rev Log: If multicast is not properly configured.. we run the chance of filling the logs with error messages on a vanila install. We now gard against this by only reporting the error mesasge the first time we hit the error. We keep trying to do mutlicast advertising, but suppress futher error messages. Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java?rev=393054&r1=393053&r2=393054&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/discovery/multicast/MulticastDiscoveryAgent.java Mon Apr 10 13:41:13 2006 @@ -73,6 +73,7 @@ private long keepAliveInterval=DEFAULT_IDLE_TIME; private long lastAdvertizeTime=0; private AtomicBoolean started=new AtomicBoolean(false); + private boolean reportAdvertizeFailed=true; private final Executor executor = new ThreadPoolExecutor(1, 1, 30, TimeUnit.SECONDS, new LinkedBlockingQueue(), new ThreadFactory() { public Thread newThread(Runnable runable) { @@ -296,7 +297,7 @@ } private void doAdvertizeSelf(){ - if(selfService!=null){ + if(selfService!=null ){ String payload=getType(); payload+=started.get()?ALIVE:DEAD; payload+=DELIMITER+brokerName+DELIMITER; @@ -305,8 +306,16 @@ byte[] data=payload.getBytes(); DatagramPacket packet=new DatagramPacket(data,0,data.length,sockAddress); mcast.send(packet); - }catch(IOException e){ - log.error("Failed to advertise our service: "+payload,e); + } catch(IOException e) { + // If a send fails, chances are all subsequent sends will fail too.. No need to keep reporting the + // same error over and over. + if( reportAdvertizeFailed ) { + reportAdvertizeFailed=false; + log.error("Failed to advertise our service: "+payload,e); + if( "Operation not permitted".equals(e.getMessage()) ) { + log.error("The 'Operation not permitted' error has been know to be caused by improper firewall/network setup. Please make sure that the OS is properly configured to allow multicast traffic over: "+mcast.getLocalAddress()); + } + } } } }