tflobbe commented on a change in pull request #444: SOLR-12708: Aggregate
failures from downstream async jobs; add error …
URL: https://github.com/apache/lucene-solr/pull/444#discussion_r256251966
##########
File path:
solr/core/src/java/org/apache/solr/cloud/api/collections/RestoreCmd.java
##########
@@ -271,7 +278,37 @@ public void call(ClusterState state, ZkNodeProps message,
NamedList results) thr
propMap.put(ASYNC, asyncId);
}
ocmh.addPropertyParams(message, propMap);
- ocmh.addReplica(clusterState, new ZkNodeProps(propMap), new
NamedList(), null);
+ final NamedList addResult = new NamedList();
+ ocmh.addReplica(clusterState, new ZkNodeProps(propMap), addResult, ()
-> {
+ countDownLatch.countDown();
+ Object addResultFailure = addResult.get("failure");
+ if (addResultFailure != null) {
+ SimpleOrderedMap failure = (SimpleOrderedMap)
results.get("failure");
+ if (failure == null) {
+ failure = new SimpleOrderedMap();
+ results.add("failure", failure);
+ }
+ failure.addAll((NamedList) addResultFailure);
+ } else {
+ SimpleOrderedMap success = (SimpleOrderedMap)
results.get("success");
+ if (success == null) {
+ success = new SimpleOrderedMap();
+ results.add("success", success);
+ }
+ success.addAll((NamedList) addResult.get("success"));
+ }
+ });
+ }
+
+ boolean allIsDone = countDownLatch.await(1, TimeUnit.HOURS);
+ if (!allIsDone) {
+ throw new TimeoutException("Initial replicas were not created within
10 minutes. Timing out.");
Review comment:
Outdated error, this is now 1 hour
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]