diff --git a/Core/0 b/Core/0 new file mode 100755 index 0000000000..32448dd115 Binary files /dev/null and b/Core/0 differ diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java index 25f28fe3c3..0a65bafcbb 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJob.java @@ -167,6 +167,7 @@ final class IngestJob { dataSourceIngestPipelines.remove(threadId); if (dataSourceIngestPipelines.isEmpty() && dataSourceTaskProgress != null) { dataSourceTaskProgress.finish(); + dataSourceTaskProgress = null; } FileIngestPipeline fileIngestPipeline = fileIngestPipelines.get(threadId); @@ -176,6 +177,7 @@ final class IngestJob { fileIngestPipelines.remove(threadId); if (fileIngestPipelines.isEmpty() && fileTasksProgress != null) { fileTasksProgress.finish(); + fileTasksProgress = null; } return errors; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 4cd4958b0e..3b8fc6470d 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -306,12 +306,17 @@ public class IngestManager { } synchronized void reportThreadDone(long threadId) { + List completedJobs = new ArrayList<>(); for (IngestJob job : ingestJobs.values()) { job.releaseIngestPipelinesForThread(threadId); if (job.areIngestPipelinesShutDown()) { - ingestJobs.remove(job.getId()); + completedJobs.add(job.getId()); } } + + for (Long jobId : completedJobs) { + ingestJobs.remove(jobId); + } } synchronized void stopAll() { @@ -334,9 +339,17 @@ public class IngestManager { // Cancel the worker threads. if (dataSourceTaskWorker != null) { dataSourceTaskWorker.cancel(true); + while (!dataSourceTaskWorker.isDone()) { + // Wait. + } + dataSourceTaskWorker = null; } if (fileTaskWorker != null) { fileTaskWorker.cancel(true); + while (!fileTaskWorker.isDone()) { + // Wait. + } + fileTaskWorker = null; } // Jettision the remaining tasks. This will dispose of any tasks that @@ -502,7 +515,6 @@ public class IngestManager { logger.log(Level.INFO, "Data source ingest thread (id={0}) cancelled", this.id); return null; } - IngestJob job = scheduler.next(); DataSourceIngestPipeline pipeline = job.getDataSourceIngestPipelineForThread(this.id); pipeline.process(this, job.getDataSourceTaskProgressBar()); @@ -544,7 +556,6 @@ public class IngestManager { IngestScheduler.FileScheduler fileScheduler = IngestScheduler.getInstance().getFileScheduler(); while (fileScheduler.hasNext()) { if (isCancelled()) { - IngestManager.getInstance().reportThreadDone(this.id); logger.log(Level.INFO, "File ingest thread (id={0}) cancelled", this.id); return null; }