Fix task in progress added 2x bug in ingest task scheduler

This commit is contained in:
Richard Cordovano 2014-11-07 16:53:32 -05:00
parent f5fa66a48f
commit 9436240ce9

View File

@ -326,7 +326,6 @@ final class IngestTasksScheduler {
// Try to add the most recently added directory from the // Try to add the most recently added directory from the
// directory tasks queue to the pending file tasks queue. // directory tasks queue to the pending file tasks queue.
FileIngestTask directoryTask = this.directoryTasks.remove(this.directoryTasks.size() - 1); FileIngestTask directoryTask = this.directoryTasks.remove(this.directoryTasks.size() - 1);
this.tasksInProgress.remove(directoryTask);
if (shouldEnqueueFileTask(directoryTask)) { if (shouldEnqueueFileTask(directoryTask)) {
addToPendingFileTasksQueue(directoryTask); addToPendingFileTasksQueue(directoryTask);
} else { } else {
@ -351,9 +350,7 @@ final class IngestTasksScheduler {
this.directoryTasks.add(childTask); this.directoryTasks.add(childTask);
} else if (shouldEnqueueFileTask(childTask)) { } else if (shouldEnqueueFileTask(childTask)) {
// Found a file, put the task directly into the // Found a file, put the task directly into the
// pending file tasks queue. The new task will // pending file tasks queue.
// be put into the tasks in progress list by the
// addToPendingFileTasksQueue() helper.
this.tasksInProgress.add(childTask); this.tasksInProgress.add(childTask);
addToPendingFileTasksQueue(childTask); addToPendingFileTasksQueue(childTask);
} }
@ -667,7 +664,7 @@ final class IngestTasksScheduler {
this.dirQueueSize = countTasksForJob(IngestTasksScheduler.this.directoryTasks, jobId); this.dirQueueSize = countTasksForJob(IngestTasksScheduler.this.directoryTasks, jobId);
this.fileQueueSize = countTasksForJob(IngestTasksScheduler.this.pendingFileTasks, jobId); this.fileQueueSize = countTasksForJob(IngestTasksScheduler.this.pendingFileTasks, jobId);
this.dsQueueSize = countTasksForJob(IngestTasksScheduler.this.pendingDataSourceTasks, jobId); this.dsQueueSize = countTasksForJob(IngestTasksScheduler.this.pendingDataSourceTasks, jobId);
this.runningListSize = countTasksForJob(IngestTasksScheduler.this.tasksInProgress, jobId) - fileQueueSize - dsQueueSize; this.runningListSize = countTasksForJob(IngestTasksScheduler.this.tasksInProgress, jobId);
} }
/** /**