Author: markt Date: Wed Nov 24 20:09:26 2010 New Revision: 1038795 URL: http://svn.apache.org/viewvc?rev=1038795&view=rev Log: Add additional trace level logging to Tribes to assist with fault diagnosis. Based on a patch by Ariel. Fix Eclipse warnings in file
Modified: tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/ParallelNioSender.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/ParallelNioSender.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/ParallelNioSender.java?rev=1038795&r1=1038794&r2=1038795&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/ParallelNioSender.java (original) +++ tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/ParallelNioSender.java Wed Nov 24 20:09:26 2010 @@ -64,6 +64,7 @@ public class ParallelNioSender extends A } + @Override public synchronized void sendMessage(Member[] destination, ChannelMessage msg) throws ChannelException { long start = System.currentTimeMillis(); this.setUdpBased((msg.getOptions()&Channel.SEND_OPTIONS_UDP) == Channel.SEND_OPTIONS_UDP); @@ -82,6 +83,7 @@ public class ParallelNioSender extends A try { remaining -= doLoop(selectTimeout, getMaxRetryAttempts(),waitForAck,msg); } catch (Exception x ) { + if (log.isTraceEnabled()) log.trace("Error sending message", x); int faulty = (cx == null)?0:cx.getFaultyMembers().length; if ( cx == null ) { if ( x instanceof ChannelException ) cx = (ChannelException)x; @@ -109,7 +111,7 @@ public class ParallelNioSender extends A throw cx; } } catch (Exception x ) { - try { this.disconnect(); } catch (Exception ignore) {} + try { this.disconnect(); } catch (Exception e) {/*Ignore*/} if ( x instanceof ChannelException ) throw (ChannelException)x; else throw new ChannelException(x); } @@ -141,6 +143,9 @@ public class ParallelNioSender extends A SenderState.getSenderState(sender.getDestination()).setReady(); }//end if } catch (Exception x) { + if (log.isTraceEnabled()) { + log.trace("Error while processing send to " + sender.getDestination().getName(), x); + } SenderState state = SenderState.getSenderState(sender.getDestination()); int attempt = sender.getAttempt()+1; boolean retry = (sender.getAttempt() <= maxAttempts && maxAttempts>0); @@ -261,10 +266,12 @@ public class ParallelNioSender extends A if ( x != null ) throw x; } + @Override public void add(Member member) { - + // NOOP } + @Override public void remove(Member member) { //disconnect senders NioSender sender = nioSenders.remove(member); @@ -275,14 +282,13 @@ public class ParallelNioSender extends A @Override public synchronized void disconnect() { setConnected(false); - try {close(); }catch (Exception x){} - + try {close(); }catch (Exception x){/*Ignore*/} } @Override public void finalize() { - try {disconnect(); }catch ( Exception ignore){} - try {selector.close();} catch (Exception ignore) {} + try {disconnect(); }catch ( Exception e){/*Ignore*/} + try {selector.close();} catch (Exception e) {/*Ignore*/} } @Override @@ -309,8 +315,8 @@ public class ParallelNioSender extends A } } } - //clean up any canceled keys - if ( result ) try { selector.selectNow(); }catch (Exception ignore){} + //clean up any cancelled keys + if ( result ) try { selector.selectNow(); }catch (Exception e){/*Ignore*/} return result; } Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1038795&r1=1038794&r2=1038795&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Wed Nov 24 20:09:26 2010 @@ -38,6 +38,14 @@ <body> <!-- General, Catalina, Coyote, Jasper, Cluster, Web applications, Extras, Other --> <section name="Tomcat 7.0.6 (markt)"> + <subsection name="Cluster"> + <changelog> + <add> + <bug>50185</bug>: Add additional trace level logging to Tribes to assist + with fault diagnosis. Based on a patch by Ariel. (markt) + </add> + </changelog> + </subsection> <subsection name="Web applications"> <changelog> <add> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org