Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void registerTask(ReconOmTask task) {
* For every registered task, we try process step twice and then reprocess
* once (if process failed twice) to absorb the events. If a task has failed
* reprocess call more than 2 times across events, it is unregistered
* (blacklisted).
* (ignored).
* @param events set of events
* @throws InterruptedException
*/
Expand Down Expand Up @@ -140,7 +140,7 @@ public synchronized void consumeOMEvents(OMUpdateEventBatch events,
results = executorService.invokeAll(tasks);
List<String> reprocessFailedTasks =
processTaskResults(results, events);
blacklistFailedTasks(reprocessFailedTasks);
ignoreFailedTasks(reprocessFailedTasks);
}
}
} catch (ExecutionException e) {
Expand All @@ -149,15 +149,15 @@ public synchronized void consumeOMEvents(OMUpdateEventBatch events,
}

/**
* Blacklist tasks that failed reprocess step more than threshold times.
* Ignore tasks that failed reprocess step more than threshold times.
* @param failedTasks list of failed tasks.
*/
private void blacklistFailedTasks(List<String> failedTasks) {
private void ignoreFailedTasks(List<String> failedTasks) {
for (String taskName : failedTasks) {
LOG.info("Reprocess step failed for task {}.", taskName);
if (taskFailureCounter.get(taskName).incrementAndGet() >
TASK_FAILURE_THRESHOLD) {
LOG.info("Blacklisting Task since it failed retry and " +
LOG.info("Ignoring task since it failed retry and " +
"reprocess more than {} times.", TASK_FAILURE_THRESHOLD);
reconOmTasks.remove(taskName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void testFailedTaskRetryLogic() throws Exception {
}

@Test
public void testBadBehavedTaskBlacklisting() throws Exception {
public void testBadBehavedTaskIsIgnored() throws Exception {
String taskName = "Dummy_" + System.currentTimeMillis();
DummyReconDBTask dummyReconDBTask =
new DummyReconDBTask(taskName, DummyReconDBTask.TaskType.ALWAYS_FAIL);
Expand All @@ -151,7 +151,7 @@ public void testBadBehavedTaskBlacklisting() throws Exception {
.get(dummyReconDBTask.getTaskName()));
}

//Should be blacklisted now.
//Should be ignored now.
reconTaskController.consumeOMEvents(omUpdateEventBatchMock,
omMetadataManagerMock);
assertTrue(reconTaskController.getRegisteredTasks().isEmpty());
Expand Down Expand Up @@ -212,4 +212,4 @@ private ReconOmTask getMockTask(String taskName) {
.thenReturn(Collections.singleton("MockTable"));
return reconOmTaskMock;
}
}
}