Author: manik.surtani(a)jboss.com
Date: 2008-07-30 11:45:51 -0400 (Wed, 30 Jul 2008)
New Revision: 6444
Modified:
core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
Log:
Catch exceptions on state retrieval and retry
Modified: core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-07-30 15:45:12 UTC
(rev 6443)
+++ core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-07-30 15:45:51 UTC
(rev 6444)
@@ -518,24 +518,33 @@
boolean successfulTransfer = false;
for (Address target : targets)
{
- if (log.isDebugEnabled())
- log.debug("Node " + getLocalAddress() + " fetching partial
state " + stateId + " from member " + target);
- messageListener.setStateSet(false);
- successfulTransfer = channel.getState(target, stateId,
configuration.getStateRetrievalTimeout());
- if (successfulTransfer)
+ try
{
- try
+ if (log.isDebugEnabled())
+ log.debug("Node " + getLocalAddress() + " fetching partial
state " + stateId + " from member " + target);
+ messageListener.setStateSet(false);
+ successfulTransfer = channel.getState(target, stateId,
configuration.getStateRetrievalTimeout());
+ if (successfulTransfer)
{
- messageListener.waitForState();
+ try
+ {
+ messageListener.waitForState();
+ }
+ catch (Exception transferFailed)
+ {
+ successfulTransfer = false;
+ }
}
- catch (Exception transferFailed)
- {
- successfulTransfer = false;
- }
+ if (log.isDebugEnabled())
+ log.debug("Node " + getLocalAddress() + " fetching partial
state " + stateId + " from member " + target + (successfulTransfer ? "
successful" : " failed"));
+ if (successfulTransfer) break;
}
- if (log.isDebugEnabled())
- log.debug("Node " + getLocalAddress() + " fetching partial
state " + stateId + " from member " + target + (successfulTransfer ? "
successful" : " failed"));
- if (successfulTransfer) break;
+ catch (IllegalStateException ise)
+ {
+ // thrown by the JGroups channel if state retrieval fails.
+ if (log.isInfoEnabled())
+ log.info("Channel problems fetching state. Continuing on to next
provider. ", ise);
+ }
}
if (!successfulTransfer)
@@ -543,6 +552,7 @@
if (log.isDebugEnabled())
log.debug("Node " + getLocalAddress() + " could not fetch
partial state " + stateId + " from any member " + targets);
}
+
}
// ------------ END: Partial state transfer methods ------------