dev@shoal.java.net

Re: CVS update: /shoal/gms/src/java/com/sun/enterprise/ee/cms/impl/jxta/GroupCommunicationProviderImpl.java

From: Bongjae Chang <carryel_at_korea.com>
Date: Wed, 20 Aug 2008 15:14:55 +0900

Hi.
I have a question about this change.
GroupCommunicationProvider.sendMessage() can be used in DistributedStateCache.addToCache API.
Assume that A, B and C are members in group.
When A adds data to DSC, first A's local cache is updated then A tries to send data to B and C.
B receives the data correctly but C doesn't receive the data because the connection between A and C has some problems.
At this case, DSC's data is not synchronized because C doesn't have A's data.
Before the following change, I thought if DistributedStateCache.addToCache() threw an exception, caller should do rollback about the data for data's synchronization among members.
In other words, I understood caller had synchronization role because API threw an exception. But API doesn't throw an exception like the following change, I think it is better that SHOAL should have rollback's logic.
cf) Before codes, only MemberNotInViewException was ignored. But though MemberNotInViewException was ignored, SHOAL could synchronize DSC's data with syncCache(). In other words, when the member that was not in view joins the group later, the master will be aware of the member in view, so the master will call DSC.synCache() method. But IOException is different from MemberNotInViewException because the member is already in view, so DSC.synCache() can't be called. Of course, if the member will be failed, there is no problem. But IOException can be occurred without member failure. ex) in the firewall

Thanks.
--
Bongjae Chang


----- Original Message -----
From: <jfialli_at_dev.java.net>
To: <cvs_at_shoal.dev.java.net>
Sent: Wednesday, August 20, 2008 6:37 AM
Subject: CVS update: /shoal/gms/src/java/com/sun/enterprise/ee/cms/impl/jxta/GroupCommunicationProviderImpl.java


> User: jfialli
> Date: 2008-08-19 21:37:07+0000
> Modified:
> shoal/gms/src/java/com/sun/enterprise/ee/cms/impl/jxta/GroupCommunicationProviderImpl.java
>
> Log:
> Fix for sendMessage when it is using reliable multicast mode. This mode is selected when sendMessage parameter
> target is null (indicating to broadcast the msg parameter to instances in the cluster) and synchronous parameter is
> true.
> Benefit of this fix is that when one a send to one of the instances in the cluster fails, the code will now log that
> failure but it will proceed to send messages to rest of instances in the cluster. Prior to this fix, failing to send to
> one instance in the cluster meant that ptp multicast would abruptly stop due to the exception, and potentially
> one or more instances in the cluster would not receive the synchronous ptp multicast message.
>
>
> Reviewed by: Sheetal Vartak
>
> File Changes:
>
> Directory: /shoal/gms/src/java/com/sun/enterprise/ee/cms/impl/jxta/
> ===================================================================
>
> File [changed]: GroupCommunicationProviderImpl.java
> Url: https://shoal.dev.java.net/source/browse/shoal/gms/src/java/com/sun/enterprise/ee/cms/impl/jxta/GroupCommunicationProviderImpl.java?r1=1.26&r2=1.27
> Delta lines: +24 -3
> --------------------
> --- GroupCommunicationProviderImpl.java 2008-08-13 20:36:25+0000 1.26
> +++ GroupCommunicationProviderImpl.java 2008-08-19 21:37:05+0000 1.27
> @@ -66,7 +66,7 @@
> *
> * @author Shreedhar Ganapathy
> * Date: Jun 26, 2006
> - * @version $Revision: 1.26 $
> + * @version $Revision: 1.27 $
> */
> public class GroupCommunicationProviderImpl implements
> GroupCommunicationProvider,
> @@ -212,11 +212,32 @@
> task.setMessage(message);
> msgSendPool.submit(task);
> */
> - logger.log(Level.FINE, "sending message to member: " + currentMemberAdv.getName());
> + logger.log(Level.FINER, "sending message to member: " + currentMemberAdv.getName());
> try {
> clusterManager.send(id, message);
> } catch (MemberNotInViewException e) {
> - logger.warning("MemberNotInViewException : " + e.toString());
> + if (logger.isLoggable(Level.FINE)) {
> + logger.fine("MemberNotInViewException : " + e.toString());
> + }
> + } catch (IOException ioe) {
> + // don't allow an exception sending to one instance of the cluster to prevent ptp multicast to all other instances of
> + // of the cluster. Catch this exception, record it and continue sending to rest of instances in the cluster.
> + if (logger.isLoggable(Level.FINE)) {
> + logger.log(Level.FINE,
> + "IOException in reliable synchronous ptp multicast sending to instance " + currentMemberAdv.getName() +
> + ". Perhaps this instance has failed but that has not been detected yet. Peer id=" +
> + id.toString(),
> + ioe);
> + }
> + } catch (Throwable t) {
> + // don't allow an exception sending to one instance of the cluster prevent ptp broadcast to all other instances of
> + // of the cluster. Catch this exception, record it and continue sending to rest of instances in the cluster.
> + if (logger.isLoggable(Level.FINE)) {
> + logger.log(Level.FINE,
> + "Exception in reliable synchronous ptp multicast sending to instance " + currentMemberAdv.getName() +
> + ", peer id=" + id.toString(),
> + t);
> + }
> }
> }
> } else {
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cvs-unsubscribe_at_shoal.dev.java.net
> For additional commands, e-mail: cvs-help_at_shoal.dev.java.net
>
>
>
>