You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bs...@apache.org on 2019/12/23 17:42:06 UTC
[geode] branch feature/GEODE-7556e created (now fe247f5)
This is an automated email from the ASF dual-hosted git repository.
bschuchardt pushed a change to branch feature/GEODE-7556e
in repository https://gitbox.apache.org/repos/asf/geode.git.
at fe247f5 GEODE-7556e - catch and translate exceptions into geode-core exceptions
This branch includes the following new commits:
new fe247f5 GEODE-7556e - catch and translate exceptions into geode-core exceptions
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[geode] 01/01: GEODE-7556e - catch and translate exceptions into
geode-core exceptions
Posted by bs...@apache.org.
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 <bs...@pivotal.io>
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;