You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2018/10/08 02:20:14 UTC
[GitHub] jihoonson commented on a change in pull request #6428: Fail
compactionTask if it fails to run one of indexTaskSpecs
jihoonson commented on a change in pull request #6428: Fail compactionTask if it fails to run one of indexTaskSpecs
URL: https://github.com/apache/incubator-druid/pull/6428#discussion_r223238845
##########
File path: indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java
##########
@@ -263,22 +263,25 @@ public TaskStatus run(final TaskToolbox toolbox) throws Exception
} else {
log.info("Generated [%d] compaction task specs", indexTaskSpecs.size());
+ int failCnt = 0;
for (IndexTask eachSpec : indexTaskSpecs) {
final String json = jsonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(eachSpec);
log.info("Running indexSpec: " + json);
try {
final TaskStatus eachResult = eachSpec.run(toolbox);
if (!eachResult.isSuccess()) {
+ failCnt++;
log.warn("Failed to run indexSpec: [%s].\nTrying the next indexSpec.", json);
}
}
catch (Exception e) {
+ failCnt++;
log.warn(e, "Failed to run indexSpec: [%s].\nTrying the next indexSpec.", json);
}
}
- return TaskStatus.success(getId());
+ return failCnt == 0 ? TaskStatus.success(getId()) : TaskStatus.failure(getId());
Review comment:
Added log.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org