Author: azeez Date: Tue Jan 8 07:55:53 2008 New Revision: 610033 URL: http://svn.apache.org/viewvc?rev=610033&view=rev Log: Checking debug level Retransmitting message to faulty members if it was not a connection failure
Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManagerListener.java webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/PropertyUpdater.java webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/GetConfigurationCommand.java webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java?rev=610033&r1=610032&r2=610033&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java (original) +++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java Tue Jan 8 07:55:53 2008 @@ -170,7 +170,9 @@ if (!isExcluded(key, context.getClass().getName(), excludedPropertyPatterns)) { - log.debug("sending property =" + key + "-" + prop); + if (log.isDebugEnabled()) { + log.debug("sending property =" + key + "-" + prop); + } PropertyDifference diff = (PropertyDifference) diffs.get(key); diff.setValue(prop); updateCmd.addProperty(diff); @@ -187,7 +189,9 @@ // Next check whether it matches an excluded pattern if (!isExcluded(key, context.getClass().getName(), excludedPropertyPatterns)) { - log.debug("sending property =" + key + "-" + prop); + if (log.isDebugEnabled()) { + log.debug("sending property =" + key + "-" + prop); + } PropertyDifference diff = new PropertyDifference(key, prop, false); updateCmd.addProperty(diff); } @@ -208,7 +212,9 @@ // First check whether it is serializable if (prop instanceof Serializable) { - log.debug("sending property =" + key + "-" + prop); + if (log.isDebugEnabled()) { + log.debug("sending property =" + key + "-" + prop); + } PropertyDifference diff = (PropertyDifference) diffs.get(key); diff.setValue(prop); updateCmd.addProperty(diff); Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManagerListener.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManagerListener.java?rev=610033&r1=610032&r2=610033&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManagerListener.java (original) +++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManagerListener.java Tue Jan 8 07:55:53 2008 @@ -27,12 +27,9 @@ public class DefaultContextManagerListener implements ContextManagerListener { private ConfigurationContext configurationContext; - private static final Log log = LogFactory.getLog(DefaultContextManagerListener.class); public void contextUpdated(ContextClusteringCommand message) throws ClusteringFault { - log.debug("Enter: DefaultContextManagerListener::contextRemoved"); message.execute(configurationContext); - log.debug("Exit: DefaultContextManagerListener::contextRemoved"); } public void setConfigurationContext(ConfigurationContext configurationContext) { Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/PropertyUpdater.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/PropertyUpdater.java?rev=610033&r1=610032&r2=610033&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/PropertyUpdater.java (original) +++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/PropertyUpdater.java Tue Jan 8 07:55:53 2008 @@ -36,7 +36,9 @@ private Map properties; public void updateProperties(AbstractContext abstractContext) { - log.debug("Updating props in " + abstractContext); + if (log.isDebugEnabled()) { + log.debug("Updating props in " + abstractContext); + } if (abstractContext != null) { for (Iterator iter = properties.keySet().iterator(); iter.hasNext();) { String key = (String) iter.next(); @@ -46,8 +48,10 @@ abstractContext.removePropertyNonReplicable(key); } else { // it is updated/added abstractContext.setNonReplicableProperty(key, propDiff.getValue()); - log.debug("Added prop=" + key + ", value=" + propDiff.getValue() + - " to context " + abstractContext); + if (log.isDebugEnabled()) { + log.debug("Added prop=" + key + ", value=" + propDiff.getValue() + + " to context " + abstractContext); + } } } } Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java?rev=610033&r1=610032&r2=610033&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java (original) +++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java Tue Jan 8 07:55:53 2008 @@ -53,7 +53,9 @@ } public void execute(ConfigurationContext configurationContext) throws ClusteringFault { - log.debug("Updating service context properties..."); + if (log.isDebugEnabled()) { + log.debug("Updating service context properties..."); + } ServiceGroupContext sgCtx = configurationContext.getServiceGroupContext(serviceGroupContextId); if (sgCtx != null) { Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java?rev=610033&r1=610032&r2=610033&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java (original) +++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java Tue Jan 8 07:55:53 2008 @@ -66,7 +66,9 @@ sgCtx.setId(serviceGroupContextId); configContext.addServiceGroupContextIntoSoapSessionTable(sgCtx); // TODO: Check this } - log.debug("###### Gonna update SG prop in " + serviceGroupContextId + "===" + sgCtx); + if (log.isDebugEnabled()) { + log.debug("Gonna update SG prop in " + serviceGroupContextId + "===" + sgCtx); + } propertyUpdater.updateProperties(sgCtx); } Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/GetConfigurationCommand.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/GetConfigurationCommand.java?rev=610033&r1=610032&r2=610033&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/GetConfigurationCommand.java (original) +++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/GetConfigurationCommand.java Tue Jan 8 07:55:53 2008 @@ -37,6 +37,8 @@ AxisConfiguration axisConfig = configCtx.getAxisConfiguration(); for (Iterator iter = axisConfig.getServiceGroups(); iter.hasNext();) { AxisServiceGroup serviceGroup = (AxisServiceGroup) iter.next(); + + //TODO: Exclude all services loaded from modules. How to handle data services etc.? serviceGroupNames.add(serviceGroup.getServiceGroupName()); } this.serviceGroupNames = Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java?rev=610033&r1=610032&r2=610033&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java (original) +++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java Tue Jan 8 07:55:53 2008 @@ -94,7 +94,9 @@ Member member = members[i]; String memberHost = TribesUtil.getHost(member); if (member.isReady() && !ack.hasACKed(memberHost)) { - log.debug("[NO ACK] from member " + memberHost); + if (log.isDebugEnabled()) { + log.debug("[NO ACK] from member " + memberHost); + } // If a new member joined the cluster recently, // we need to retransmit the message to this member, if an ACK has not been @@ -103,8 +105,10 @@ !ack.isRestransmittedToMember(memberHost)) { // TODO: Check sender.sendToMember(ack.getCommand(), member); - log.debug("Retransimitting msg " + ack.getCommand().getUniqueId() + - " to member " + memberHost); + if (log.isDebugEnabled()) { + log.debug("Retransimitting msg " + ack.getCommand().getUniqueId() + + " to member " + memberHost); + } } if (!isReturnValueSet) { Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java?rev=610033&r1=610032&r2=610033&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java (original) +++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java Tue Jan 8 07:55:53 2008 @@ -139,7 +139,9 @@ log.warn("Received message before cluster initialization has been completed"); return; } - log.debug("Received message " + msg + " from " + TribesUtil.getHost(sender)); + if (log.isDebugEnabled()) { + log.debug("Received message " + msg + " from " + TribesUtil.getHost(sender)); + } try { processMessage(msg, sender); } catch (Exception e) { @@ -156,7 +158,9 @@ // Check for duplicate messages and ignore duplicates in order to support at-most-once semantics if (receivedMessages.containsKey(msgId)) { - log.debug("Received duplicate message " + ctxCmd); + if (log.isDebugEnabled()) { + log.debug("Received duplicate message " + ctxCmd); + } receivedMessages.put(msgId, new Long(System.currentTimeMillis()));// Let's keep track of the message as well as the time at which it was last received return; } @@ -198,6 +202,9 @@ for (Iterator iterator = toBeRemoved.iterator(); iterator.hasNext();) { String msgId = (String) iterator.next(); receivedMessages.remove(msgId); + if (log.isDebugEnabled()) { + log.debug("Removed message " + msgId + " from received message buffer"); + } } } } Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java?rev=610033&r1=610032&r2=610033&view=diff ============================================================================== --- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java (original) +++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java Tue Jan 8 07:55:53 2008 @@ -49,30 +49,27 @@ // Keep retrying, since at the point of trying to send the msg, a member may leave the group // causing a view change. All nodes in a view should get the msg - //TODO: Sometimes Tribes incorrectly detects that a member has left a group -// while (true) { if (members.length > 0) { try { long start = System.currentTimeMillis(); channel.send(members, toByteMessage(msg), Channel.SEND_OPTIONS_USE_ACK); timeToSend = System.currentTimeMillis() - start; log.debug("Sent " + msg + " to group"); -// break; } catch (NotSerializableException e) { String message = "Could not send command message " + msg + " to group since it is not serializable."; log.error(message, e); throw new ClusteringFault(message, e); } catch (ChannelException e) { - //TODO: What to do for faulty members ChannelException.FaultyMember[] faultyMembers = e.getFaultyMembers(); for (int i = 0; i < faultyMembers.length; i++) { ChannelException.FaultyMember faultyMember = faultyMembers[i]; Member member = faultyMember.getMember(); log.error("Member " + TribesUtil.getHost(member) + " is faulty. Cause " + faultyMember.getCause(), faultyMember.getCause()); - - //TODO: Shall we try to resend to these members? + if (!(e.getCause() instanceof java.net.ConnectException)) { // If it is not a connection exception, we try to resend the message + sendToMember(msg, member); + } } } catch (Exception e) { @@ -81,10 +78,6 @@ log.warn(message, e); } } -// else { -// break; -// } -// } return timeToSend; } @@ -128,7 +121,10 @@ } catch (ChannelException e) { ChannelException.FaultyMember[] faultyMembers = e.getFaultyMembers(); log.error("Member " + TribesUtil.getHost(member) + " is faulty. Cause " + - faultyMembers[0].getCause(), faultyMembers[0].getCause()); + faultyMembers[0].getCause(), faultyMembers[0].getCause()); + if (!(e.getCause() instanceof java.net.ConnectException)) { // If it is not a connection exception, we try to resend the message + sendToMember(cmd, member); + } } catch (Exception e) { String message = "Could not send message to " + TribesUtil.getHost(member) + ". Reason " + e.getMessage(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]