dschneider-pivotal commented on a change in pull request #6914:
URL: https://github.com/apache/geode/pull/6914#discussion_r718724159



##########
File path: 
geode-core/src/main/java/org/apache/geode/management/internal/operation/OperationHistoryManager.java
##########
@@ -96,10 +96,15 @@ private static boolean isExpired(long expirationTime, 
OperationState<?, ?> opera
   }
 
   private OperationState<?, ?> validateLocator(OperationState<?, ?> 
operationState) {
+    if (operationState.getOperationEnd() != null) {
+      return operationState;
+    }
     if (isLocatorOffline(operationState)) {
       operationState.setOperationEnd(new Date(), null,
           new RuntimeException("Locator that initiated the Rest API operation 
is offline: "
               + operationState.getLocator()));
+      operationStateStore.recordEnd(operationState.getId(), 
operationState.getResult(),

Review comment:
       I think you should call "recordEnd" here instead of 
"operationStateStore.recordEnd". Also it looks like recordEnd will in turn call 
operationState.setOperationEnd. So I think this whole if block could just be 
this one call: recordEnd(new Date(), null,
             new RuntimeException("Locator that initiated the Rest API 
operation is offline: "
                 + operationState.getLocator()));




-- 
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: [email protected]

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


Reply via email to