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/10 23:16:08 UTC

[GitHub] [geode] jinmeiliao opened a new pull request, #7677: GEODE-10286: handle CancelException in PersistenceAdvisor.close

jinmeiliao opened a new pull request, #7677:
URL: https://github.com/apache/geode/pull/7677

   * GEODE-10287: do distAdvisor.close after waitForCurrentOperations()


-- 
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


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

Posted by GitBox <gi...@apache.org>.
jinmeiliao commented on code in PR #7677:
URL: https://github.com/apache/geode/pull/7677#discussion_r871791382


##########
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:
   as we are in the cleanup phase, if we throw the exception, the rest of the cleanup will be skipped, which is not what we want. This behavior is consistent with other advisor close method in the `DistributedRegion`, as in DLockService.close and `DistributionAdvisor.close`



-- 
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


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

Posted by GitBox <gi...@apache.org>.
DonalEvans commented on code in PR #7677:
URL: https://github.com/apache/geode/pull/7677#discussion_r870834942


##########
geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java:
##########
@@ -2605,6 +2604,7 @@ protected void distributedRegionCleanup(RegionEventImpl event) {
       }
     }
     waitForCurrentOperations();
+    distAdvisor.close();

Review Comment:
   It seems that this change is leading to the `ConnectionCloseSSLTLSDUnitTest.connectionWithHungReaderIsCloseableAndUnhangsReader()` test hanging



-- 
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


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

Posted by GitBox <gi...@apache.org>.
jinmeiliao commented on code in PR #7677:
URL: https://github.com/apache/geode/pull/7677#discussion_r871791812


##########
geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java:
##########
@@ -2605,6 +2604,7 @@ protected void distributedRegionCleanup(RegionEventImpl event) {
       }
     }
     waitForCurrentOperations();
+    distAdvisor.close();

Review Comment:
   Yeah, looks like this is the reason, I am going to leave GEODE-10287 out of this PR.



-- 
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


[GitHub] [geode] jinmeiliao merged pull request #7677: GEODE-10286: handle CancelException in PersistenceAdvisor.close

Posted by GitBox <gi...@apache.org>.
jinmeiliao merged PR #7677:
URL: https://github.com/apache/geode/pull/7677


-- 
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


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

Posted by GitBox <gi...@apache.org>.
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