From 3edb33b8f3142576b7147e20cfcf4f62a0c8045e Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 8 Dec 2021 10:07:15 -0500 Subject: [PATCH] 7529 no error msg for ignored tasks --- .../autopsy/ingest/IngestJobExecutor.java | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobExecutor.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobExecutor.java index 4a15bf2e4f..01a38d7440 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobExecutor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobExecutor.java @@ -117,7 +117,7 @@ final class IngestJobExecutor { private AnalysisResultIngestPipeline analysisResultIngestPipeline; /* - * An ingest job transistion through several states during its execution. + * An ingest job transistions through several states during its execution. */ private static enum IngestJobState { /* @@ -1357,10 +1357,29 @@ final class IngestJobExecutor { */ void addAnalysisResults(List results) { if (!isCancelled() && hasAnalysisResultIngestModules()) { - if (jobState.equals(IngestJobState.STREAMED_FILE_ANALYSIS_ONLY) || jobState.equals(IngestJobState.FILE_AND_HIGH_PRIORITY_DATA_SRC_LEVEL_ANALYSIS) || jobState.equals(IngestJobState.LOW_PRIORITY_DATA_SRC_LEVEL_ANALYSIS)) { - taskScheduler.scheduleAnalysisResultIngestTasks(this, results); - } else { - logErrorMessage(Level.SEVERE, "Attempt to add analysis results to job during stage " + jobState.toString() + " not supported"); + switch (jobState) { + case STREAMED_FILE_ANALYSIS_ONLY: + case FILE_AND_HIGH_PRIORITY_DATA_SRC_LEVEL_ANALYSIS: + case LOW_PRIORITY_DATA_SRC_LEVEL_ANALYSIS: + taskScheduler.scheduleAnalysisResultIngestTasks(this, results); + break; + case PIPELINES_SHUTTING_DOWN: + /* + * Don't log an error if there is an attempt to add an + * analysis result ingest task in a pipeline shut down + * state. This is a work around for dealing with analysis + * results generated by a final keyword search carried out + * during ingest module shut down by simply ignoring them. + * Other ideas were to add a startShutDown() phase to the + * ingest module life cycle (complicated), or to add a flag + * to keyword hit processing to suppress posting the keyword + * hit analysis results to the blackboard during a final + * search (API changes required to allow firing of the event + * to make any GUI refresh). + */ + break; + default: + logErrorMessage(Level.SEVERE, "Attempt to add analysis results to job during stage " + jobState.toString() + " not supported"); } } }