This is an automated email from the ASF dual-hosted git repository. bschuchardt pushed a commit to branch feature/GEODE-7556e in repository https://gitbox.apache.org/repos/asf/geode.git
commit fe247f5aa62bad035f8a64833a1f7be01cef8b38 Author: Bruce Schuchardt <[email protected]> AuthorDate: Mon Dec 23 09:39:10 2019 -0800 GEODE-7556e - catch and translate exceptions into geode-core exceptions added a few more translation points. These changes are for non-opensource legacy tests that are looking for ForcedDisconnectException as a cause for a cache disconnecting. There is nothing in Geode that expects this so I have not added tests that require it. --- .../apache/geode/distributed/internal/ClusterDistributionManager.java | 4 ++++ .../java/org/apache/geode/distributed/internal/DistributionImpl.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java index f8c1b1b..bd195f3 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java @@ -63,6 +63,7 @@ import org.apache.geode.distributed.Role; import org.apache.geode.distributed.internal.locks.ElderState; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.distributed.internal.membership.gms.api.MemberData; +import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifierFactory; import org.apache.geode.distributed.internal.membership.gms.api.Membership; @@ -2868,6 +2869,9 @@ public class ClusterDistributionManager implements DistributionManager { } if (e == null) { + if (rc instanceof MemberDisconnectedException) { + rc = new ForcedDisconnectException(rc.getMessage()); + } // Caller did not specify any root cause, so just use our own. return new DistributedSystemDisconnectedException(reason, rc); } diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionImpl.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionImpl.java index 323da85..ed3fe7f 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionImpl.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionImpl.java @@ -383,8 +383,10 @@ public class DistributionImpl implements Distribution { checkCancelled(); } } catch (MembershipClosedException e) { + checkCancelled(); throw new DistributedSystemDisconnectedException(e.getMessage(), e.getCause()); } catch (DistributedSystemDisconnectedException ex) { + checkCancelled(); throw ex; } catch (ConnectExceptions ex) { // Check if the connect exception is due to system shutting down. @@ -424,12 +426,14 @@ public class DistributionImpl implements Distribution { return new HashSet<>(members); } // catch ConnectionExceptions catch (ToDataException | CancelException e) { + checkCancelled(); throw e; } catch (NotSerializableException | RuntimeException | Error e) { if (logger.isDebugEnabled()) { logger.debug("Membership: directChannelSend caught exception: {}", e.getMessage(), e); } + checkCancelled(); throw e; } return null;
