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/02/02 16:03:46 UTC

[GitHub] [geode] jmelchio opened a new pull request #7334: GEODE-9990: turn DiskAccessException into CacheClosedException

jmelchio opened a new pull request #7334:
URL: https://github.com/apache/geode/pull/7334


   - when DiskInitFile is in closed state and DiskStoreImpl is closed or
     closing
   - catch DiskAccessException in PRHARedundancyProvider and turn into
     CacheClosedException if cache closing is in progress
   - change CreateBucketMessage to handle DiskAccessException as cause of
     ReplyException
   
   


-- 
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 pull request #7334: GEODE-9990: turn DiskAccessException into CacheClosedException

Posted by GitBox <gi...@apache.org>.
jinmeiliao commented on pull request #7334:
URL: https://github.com/apache/geode/pull/7334#issuecomment-1034017437


   some unit test to test the updated code path would be nice


-- 
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] agingade commented on a change in pull request #7334: GEODE-9990: turn DiskAccessException into CacheClosedException

Posted by GitBox <gi...@apache.org>.
agingade commented on a change in pull request #7334:
URL: https://github.com/apache/geode/pull/7334#discussion_r801885458



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java
##########
@@ -1310,7 +1311,16 @@ private void writeIFRecord(ByteBuffer bb) throws IOException {
   private void writeIFRecord(ByteBuffer bb, boolean doStats) throws IOException {
     assert lock.isHeldByCurrentThread();
     if (closed) {
-      throw new DiskAccessException("The disk store is closed", parent);
+      parent.getCache().getCancelCriterion().checkCancelInProgress();
+
+      if (parent.isClosed() || parent.isClosing()) {
+        throw new CacheClosedException("The disk store is closed or closing");

Review comment:
       The cache is not closed yet. But is going to be closed by the exception with disk-store. Also the cache close happens in the async thread, that will take some time to get initiated.




-- 
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] gesterzhou commented on a change in pull request #7334: GEODE-9990: turn DiskAccessException into CacheClosedException

Posted by GitBox <gi...@apache.org>.
gesterzhou commented on a change in pull request #7334:
URL: https://github.com/apache/geode/pull/7334#discussion_r804930253



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java
##########
@@ -1310,7 +1311,16 @@ private void writeIFRecord(ByteBuffer bb) throws IOException {
   private void writeIFRecord(ByteBuffer bb, boolean doStats) throws IOException {
     assert lock.isHeldByCurrentThread();
     if (closed) {
-      throw new DiskAccessException("The disk store is closed", parent);
+      parent.getCache().getCancelCriterion().checkCancelInProgress();
+
+      if (parent.isClosed() || parent.isClosing()) {
+        throw new CacheClosedException("The disk store is closed or closing");

Review comment:
       I wonder if we should use OplogCancelledException instead of CacheClosedException here?




-- 
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] dschneider-pivotal commented on a change in pull request #7334: GEODE-9990: turn DiskAccessException into CacheClosedException

Posted by GitBox <gi...@apache.org>.
dschneider-pivotal commented on a change in pull request #7334:
URL: https://github.com/apache/geode/pull/7334#discussion_r800895914



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java
##########
@@ -1310,7 +1311,16 @@ private void writeIFRecord(ByteBuffer bb) throws IOException {
   private void writeIFRecord(ByteBuffer bb, boolean doStats) throws IOException {
     assert lock.isHeldByCurrentThread();
     if (closed) {
-      throw new DiskAccessException("The disk store is closed", parent);
+      parent.getCache().getCancelCriterion().checkCancelInProgress();

Review comment:
       Could you extract this whole "if" block into a method "checkClosed"? We currently would call checkClosed from two places so this would get rid of some code duplication

##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
##########
@@ -3217,14 +3217,16 @@ public void forceIFCompaction() {
     @Override
     public String cancelInProgress() {
       if (isClosed()) {
-        return "The disk store is closed.";
+        return "The disk store is closed";
       } else {
         return null;
       }
     }
 
     @Override
     public RuntimeException generateCancelledException(Throwable e) {
+      logger.info("DiskStoreImpl.isClosed(): " + isClosed() + " isClosing(): " + isClosing());

Review comment:
       this looks like it might be debug logging that should be removed. It does not look like a log message that would be helpful to customers




-- 
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] jmelchio merged pull request #7334: GEODE-9990: turn DiskAccessException into CacheClosedException

Posted by GitBox <gi...@apache.org>.
jmelchio merged pull request #7334:
URL: https://github.com/apache/geode/pull/7334


   


-- 
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 change in pull request #7334: GEODE-9990: turn DiskAccessException into CacheClosedException

Posted by GitBox <gi...@apache.org>.
jchen21 commented on a change in pull request #7334:
URL: https://github.com/apache/geode/pull/7334#discussion_r804903546



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java
##########
@@ -1310,7 +1311,16 @@ private void writeIFRecord(ByteBuffer bb) throws IOException {
   private void writeIFRecord(ByteBuffer bb, boolean doStats) throws IOException {
     assert lock.isHeldByCurrentThread();
     if (closed) {
-      throw new DiskAccessException("The disk store is closed", parent);
+      parent.getCache().getCancelCriterion().checkCancelInProgress();
+
+      if (parent.isClosed() || parent.isClosing()) {
+        throw new CacheClosedException("The disk store is closed or closing");

Review comment:
       Right. Looking into `cancelInProgress()` in `DiskStoreImpl.Stopper`, it only checks`isClosed()`. But it doesn't check `isClosing()`. It is good to have `if (parent.isClosed() || parent.isClosing())` here.




-- 
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 change in pull request #7334: GEODE-9990: turn DiskAccessException into CacheClosedException

Posted by GitBox <gi...@apache.org>.
jchen21 commented on a change in pull request #7334:
URL: https://github.com/apache/geode/pull/7334#discussion_r801007811



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java
##########
@@ -1310,7 +1311,16 @@ private void writeIFRecord(ByteBuffer bb) throws IOException {
   private void writeIFRecord(ByteBuffer bb, boolean doStats) throws IOException {
     assert lock.isHeldByCurrentThread();
     if (closed) {
-      throw new DiskAccessException("The disk store is closed", parent);
+      parent.getCache().getCancelCriterion().checkCancelInProgress();
+
+      if (parent.isClosed() || parent.isClosing()) {
+        throw new CacheClosedException("The disk store is closed or closing");

Review comment:
       I am not sure why `CacheClosedException` is thrown here. If the cache is closed, I assume `checkCancelInProgress` will throw `CacheClosedException`.




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