You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/05/11 21:28:21 UTC

[GitHub] [geode] jchen21 commented on a diff in pull request #7677: GEODE-10286, GEODE-10287: handle CancelException in PersistenceAdvisor.close

jchen21 commented on code in PR #7677:
URL: https://github.com/apache/geode/pull/7677#discussion_r870769588


##########
geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistenceAdvisorImpl.java:
##########
@@ -1161,11 +1162,19 @@ public void checkInterruptedByShutdownAll() {
 
   @Override
   public void close() {
-    isClosed = true;
-    persistentMemberManager.removeRevocationListener(profileChangeListener);
-    cacheDistributionAdvisor.removeProfileChangeListener(profileChangeListener);
-    persistentStateListeners = Collections.emptySet();
-    releaseTieLock();
+    try {
+      synchronized (this) {
+        isClosed = true;
+        persistentMemberManager.removeRevocationListener(profileChangeListener);
+        cacheDistributionAdvisor.removeProfileChangeListener(profileChangeListener);
+        persistentStateListeners = Collections.emptySet();
+        releaseTieLock();
+      }
+    } catch (CancelException e) {
+      logger.debug("persistence advisor close abridged due to shutdown", e);
+    } catch (Exception ex) {

Review Comment:
   If there is Exception other than `CancelException`, I don't think the Exception can be ignored. It should be thrown.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org