ijioio commented on a change in pull request #595:
URL: https://github.com/apache/solr/pull/595#discussion_r801556566



##########
File path: 
solr/core/src/java/org/apache/solr/cloud/api/collections/BackupCmd.java
##########
@@ -138,6 +138,15 @@ public void call(ClusterState state, ZkNodeProps message, 
NamedList<Object> resu
 
       backupMgr.writeBackupProperties(backupProperties);
 
+      // It can't be done within aggregateResults call
+      // since endTime is filled later
+      if(backupProperties != null) {
+        // It is safe to extract results here
+        @SuppressWarnings("unchecked")
+        NamedList<Object> response = (NamedList<Object>) 
results.get("response");
+        response.add("endTime", backupProperties.getEndTime());

Review comment:
       @cpoerschke  Good point! My idea was that calling this block:
   
   ```java
         if(backupProperties != null) {
           // It is safe to extract results here
           @SuppressWarnings("unchecked")
           NamedList<Object> response = (NamedList<Object>) 
results.get("response");
           response.add("endTime", backupProperties.getEndTime());
         }
   ```
   immediately follows after the call of 
`backupMgr.writeBackupProperties(backupProperties)`. It is where `endTime` is 
initiated/filled. I was supposed that it will be guaranteed to fill. In case of 
exception thrown within `writeBackupProperties` it will terminate the outer 
`call` method completely.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to