kirklund commented on a change in pull request #5778:
URL: https://github.com/apache/geode/pull/5778#discussion_r541332662



##########
File path: 
geode-core/src/main/java/org/apache/geode/management/internal/ManagementCacheListener.java
##########
@@ -104,13 +101,19 @@ public void afterUpdate(EntryEvent<String, Object> event) 
{
       if (logger.isDebugEnabled()) {
         logger.debug("Proxy Update failed for {} with exception {}", 
objectName, e.getMessage(), e);
       }
-
     }
+  }
 
+  private void blockUntilReady() {
+    try {
+      readyForEvents.await();
+    } catch (InterruptedException e) {
+      Thread.interrupted();

Review comment:
       Another option which might be more correct and it matches most of the 
Geode code more closely:
   ```
   boolean interrupted = false;
   try {
     readyForEvents.await();
   } catch (InterruptedException e) {
     interrupted = true;
     cancelCriterion.checkCancelInProgress(ie);
     throw new RuntimeException(e);
   } finally {
     if (interrupted) {
       Thread.currentThread().interrupt();
     }
   }
   ```
   The effect is that if the thread is interrupted, then we prefer Cache closed 
exception or DistributedSystem disconnected exception first. If neither is 
occurring then we throw new RuntimeException as a last resort. And then finally 
we reset the thread interrupt flag since we didn't actually handle the 
interrupt locally here by halting the Runnable that the thread is executing. 
The code is basically passing along a runtime exception and interrupt flag back 
to the calling code to let it deal with both.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to