From 2f17df455fe3a8394ae370ea778eba1f28c8dbf2 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 10 Apr 2019 16:13:53 -0400 Subject: [PATCH 1/3] Fix AIM crash recovery putting joh in wrong list --- .../autoingest/AutoIngestManager.java | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java index a8517b6faf..d6ff923746 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java @@ -1271,12 +1271,12 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen * @param nodeData The data stored in the manifest file coordination * service node for the job. * - * @throws AutoIngestJobException If there was an error working - * with the node data. - * @throws InterruptedException If the thread running the input - * directory scan task is - * interrupted while blocked, i.e., - * if auto ingest is shutting down. + * @throws AutoIngestJobException If there was an error working with the + * node data. + * @throws InterruptedException If the thread running the input + * directory scan task is interrupted + * while blocked, i.e., if auto ingest is + * shutting down. */ private void addPendingJob(Manifest manifest, AutoIngestJobNodeData nodeData) throws AutoIngestJobException, InterruptedException { AutoIngestJob job; @@ -1415,6 +1415,8 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen sysLogger.log(Level.SEVERE, String.format("Error writing case auto ingest log entry for crashed job for %s", manifestPath), ex); } } + updateAutoIngestJobData(job); + newPendingJobsList.add(job); } else { job.setProcessingStatus(AutoIngestJob.ProcessingStatus.COMPLETED); job.setCompletedDate(Date.from(Instant.now())); @@ -1425,9 +1427,9 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen sysLogger.log(Level.SEVERE, String.format("Error writing case auto ingest log entry for crashed job for %s", manifestPath), ex); } } + updateAutoIngestJobData(job); + newCompletedJobsList.add(job); } - updateAutoIngestJobData(job); - newPendingJobsList.add(job); } } } @@ -1440,12 +1442,12 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen * @param nodeData The data stored in the manifest file lock * coordination service node for the job. * - * @throws AutoIngestJobException If there was an error working - * with the node data. - * @throws InterruptedException If the thread running the input - * directory scan task is - * interrupted while blocked, i.e., - * if auto ingest is shutting down. + * @throws AutoIngestJobException If there was an error working with the + * node data. + * @throws InterruptedException If the thread running the input + * directory scan task is interrupted + * while blocked, i.e., if auto ingest is + * shutting down. */ private void addCompletedJob(Manifest manifest, AutoIngestJobNodeData nodeData) throws AutoIngestJobException, InterruptedException { Path caseDirectoryPath = nodeData.getCaseDirectoryPath(); From 7d4fe354f252c6325b2dfa37fb5899e0554cf515 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 10 Apr 2019 16:32:09 -0400 Subject: [PATCH 2/3] Fix AIM job dequeueing --- .../experimental/autoingest/AutoIngestManager.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java index d6ff923746..57e8f7e0f2 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java @@ -1997,15 +1997,26 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen AutoIngestJobNodeData nodeData = new AutoIngestJobNodeData(coordinationService.getNodeData(CoordinationService.CategoryNode.MANIFESTS, manifestPath.toString())); if (!nodeData.getProcessingStatus().equals(PENDING)) { iterator.remove(); + manifestLock.release(); + manifestLock = null; continue; } + /* + * Ditto for the presence of the manifest file. + */ File manifestFile = nodeData.getManifestFilePath().toFile(); if (!manifestFile.exists()) { iterator.remove(); + manifestLock.release(); + manifestLock = null; continue; } + /* + * Finally, check for devoting to many resources to a + * single case, if the check is enabled. + */ if (enforceMaxJobsPerCase) { int currentJobsForCase = 0; for (AutoIngestJob runningJob : hostNamesToRunningJobs.values()) { From faec58bd50216e550c662f322b692f3349b15793 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 10 Apr 2019 16:34:07 -0400 Subject: [PATCH 3/3] Fix AIM comment typo --- .../autopsy/experimental/autoingest/AutoIngestManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java index 57e8f7e0f2..4bade61c1c 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java @@ -2014,7 +2014,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen } /* - * Finally, check for devoting to many resources to a + * Finally, check for devoting too many resources to a * single case, if the check is enabled. */ if (enforceMaxJobsPerCase) {