You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2018/02/26 21:21:35 UTC
[geode] branch develop updated: GEODE-4675: remove checkConnected
calls while notifying listeners (#1495)
This is an automated email from the ASF dual-hosted git repository.
dschneider pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 889da89 GEODE-4675: remove checkConnected calls while notifying listeners (#1495)
889da89 is described below
commit 889da898b5adf1864dd61a05ab01549ae6edcaf5
Author: Darrel Schneider <ds...@pivotal.io>
AuthorDate: Mon Feb 26 13:21:32 2018 -0800
GEODE-4675: remove checkConnected calls while notifying listeners (#1495)
A call of checkConnected ended up being made from notifyListenersMemberRemoved
which could cause it to throw DistributedSystemDisconnectedException if
the distributed system was being shutdown.
So now the distribution manager is made without this check being done.
Also change to log level from fatal to warn and improved the log message.
---
.../distributed/internal/DistributionAdvisor.java | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionAdvisor.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionAdvisor.java
index 4cf79b0..955342c 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionAdvisor.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionAdvisor.java
@@ -380,6 +380,14 @@ public class DistributionAdvisor {
return getAdvisee().getDistributionManager();
}
+ /**
+ * Like getDistributionManager but does not check
+ * that the DistributedSystem is still connected
+ */
+ private DistributionManager getDistributionManagerWithNoCheck() {
+ return getAdvisee().getSystem().getDM();
+ }
+
public DistributionAdvisee getAdvisee() {
return this.advisee;
}
@@ -1210,10 +1218,9 @@ public class DistributionAdvisor {
Iterator it = membershipListeners.keySet().iterator();
while (it.hasNext()) {
try {
- ((MembershipListener) it.next()).memberJoined(getDistributionManager(), member);
+ ((MembershipListener) it.next()).memberJoined(getDistributionManagerWithNoCheck(), member);
} catch (Exception e) {
- logger.fatal(
- LocalizedMessage.create(LocalizedStrings.DistributionAdvisor_UNEXPECTED_EXCEPTION), e);
+ logger.warn("Ignoring exception during member joined listener notification", e);
}
}
}
@@ -1222,10 +1229,10 @@ public class DistributionAdvisor {
Iterator it = membershipListeners.keySet().iterator();
while (it.hasNext()) {
try {
- ((MembershipListener) it.next()).memberDeparted(getDistributionManager(), member, crashed);
+ ((MembershipListener) it.next()).memberDeparted(getDistributionManagerWithNoCheck(), member,
+ crashed);
} catch (Exception e) {
- logger.fatal(
- LocalizedMessage.create(LocalizedStrings.DistributionAdvisor_UNEXPECTED_EXCEPTION), e);
+ logger.warn("Ignoring exception during member departed listener notification", e);
}
}
}
--
To stop receiving notification emails like this one, please contact
dschneider@apache.org.