diff --git a/src/main/java/eu/openaire/urls_controller/services/BulkImportServiceImpl.java b/src/main/java/eu/openaire/urls_controller/services/BulkImportServiceImpl.java index 9407e86..0725d5f 100644 --- a/src/main/java/eu/openaire/urls_controller/services/BulkImportServiceImpl.java +++ b/src/main/java/eu/openaire/urls_controller/services/BulkImportServiceImpl.java @@ -156,13 +156,19 @@ public class BulkImportServiceImpl implements BulkImportService { // The failed-to-be-imported files, will not be deleted, even if the user specifies that he wants to delete the directory. } catch (ExecutionException ee) { // These can be serious errors like an "out of memory exception" (Java HEAP). numFailedSegments ++; + numAllFailedFiles += subLists.get(i).size(); // We assume all files of this segment failed, as all are passed through the same parts of code, so any serious exception should arise from the 1st files being processed and the rest of the files wil be skipped.. logger.error(GenericUtils.getSelectedStackTraceForCausedException(ee, "Task_" + i + " failed with: ", additionalLoggingMsg, 15)); + bulkImportReport.addEvent("Segment_" + i + " failed with: " + ee.getCause().getMessage()); } catch (CancellationException ce) { numFailedSegments ++; + numAllFailedFiles += subLists.get(i).size(); // We assume all files have failed. logger.error("Task_" + i + " was cancelled: " + ce.getMessage() + additionalLoggingMsg); + bulkImportReport.addEvent("Segment_" + i + " failed with: " + ce.getMessage()); } catch (InterruptedException ie) { numFailedSegments ++; + numAllFailedFiles += (subLists.get(i).size() / 3); // In this case, only some of the files will have failed (do not know how many). logger.error("Task_" + i + " was interrupted: " + ie.getMessage()); + bulkImportReport.addEvent("Segment_" + i + " failed with: " + ie.getMessage()); } catch (IndexOutOfBoundsException ioobe) { logger.error("IOOBE for task_" + i + " in the futures-list! " + ioobe.getMessage() + additionalLoggingMsg); }