From 9cf5efbf1e999f0a5200d6e3972b2bb3cecfbb5f Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Fri, 20 Dec 2013 10:55:42 -0500 Subject: [PATCH] catch calls to complete() and return to old approach of calling init() on each module --- .../autopsy/ingest/IngestManager.java | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index 7b1b766fa0..671325412d 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -445,9 +445,16 @@ public class IngestManager { //init all fs modules, everytime new worker starts for (IngestModuleAbstractFile s : abstractFileModules) { - if (fileScheduler.hasModuleEnqueued(s) == false) { - continue; - } + // This was added at one point to remove the message about non-configured HashDB even + // when HashDB was not enabled. However, it adds some problems if a second ingest is + // kicked off whiel the first is ongoing. If the 2nd ingest has a module enabled that + // was not initially enabled, it will never have init called. We also need to call + // complete and need a similar way of passing down data to that thread to tell it which + // it shoudl call complete on (otherwise it could call complete on a module that never + // had init() called. + //if (fileScheduler.hasModuleEnqueued(s) == false) { + // continue; + //} IngestModuleInit moduleInit = new IngestModuleInit(); try { s.init(moduleInit); @@ -1080,8 +1087,13 @@ public class IngestManager { //notify modules of completion if (!this.isCancelled()) { for (IngestModuleAbstractFile s : abstractFileModules) { - s.complete(); - IngestManager.fireModuleEvent(IngestModuleEvent.COMPLETED.toString(), s.getName()); + try { + s.complete(); + IngestManager.fireModuleEvent(IngestModuleEvent.COMPLETED.toString(), s.getName()); + } + catch (Exception ex) { + logger.log(Level.SEVERE, "Module " + s.getName() + " threw exception during call to complete()", ex); + } } } @@ -1093,13 +1105,11 @@ public class IngestManager { } catch (CancellationException e) { //task was cancelled handleInterruption(); - } catch (InterruptedException ex) { handleInterruption(); } catch (ExecutionException ex) { handleInterruption(); logger.log(Level.SEVERE, "Fatal error during ingest.", ex); - } catch (Exception ex) { handleInterruption(); logger.log(Level.SEVERE, "Fatal error during ingest.", ex);