diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/BiogridOrcExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/BiogridOrcExecutor.java index 7a2696467..bb133e658 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/BiogridOrcExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/BiogridOrcExecutor.java @@ -121,8 +121,8 @@ private void runLoad(BulkLoadFileHistory history, List biogrid } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/ExpressionAtlasExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/ExpressionAtlasExecutor.java index b85e6e168..c581b699a 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/ExpressionAtlasExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/ExpressionAtlasExecutor.java @@ -53,6 +53,11 @@ public void execLoad(BulkLoadFileHistory bulkLoadFileHistory) throws IOException } private void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataProvider, List identifiers) { + if (Thread.currentThread().isInterrupted()) { + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); + } + ProcessDisplayHelper ph = new ProcessDisplayHelper(); ph.addDisplayHandler(loadProcessDisplayService); if (CollectionUtils.isNotEmpty(identifiers)) { @@ -89,8 +94,8 @@ private void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPr } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } updateHistory(history); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExpressionExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExpressionExecutor.java index 05568c338..fe5f39254 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExpressionExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneExpressionExecutor.java @@ -23,7 +23,6 @@ import org.alliancegenome.curation_api.util.ProcessDisplayHelper; import org.apache.commons.lang3.StringUtils; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -112,8 +111,8 @@ private void loadExperiments(BulkLoadFileHistory history, BackendBulkDataProvide } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } updateHistory(history); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneOntologyAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneOntologyAnnotationExecutor.java index 0ef32ed41..9cdd82c20 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneOntologyAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneOntologyAnnotationExecutor.java @@ -26,7 +26,6 @@ import org.alliancegenome.curation_api.util.ProcessDisplayHelper; import org.apache.commons.lang3.StringUtils; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -110,8 +109,8 @@ public void execLoad(BulkLoadFileHistory bulkLoadFileHistory) throws IOException } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + bulkLoadFileHistory.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } bulkLoadFileHistory.setTotalCount(dtos.size()); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeoXrefExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeoXrefExecutor.java index 0d3d094bf..dc2325000 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeoXrefExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeoXrefExecutor.java @@ -56,6 +56,10 @@ public void execLoad(BulkLoadFileHistory bulkLoadFileHistory) throws IOException } private void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataProvider, List entrezIds) { + if (Thread.currentThread().isInterrupted()) { + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); + } ProcessDisplayHelper ph = new ProcessDisplayHelper(); ph.addDisplayHandler(loadProcessDisplayService); if (CollectionUtils.isNotEmpty(entrezIds)) { @@ -92,8 +96,8 @@ private void runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dataPr } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } updateHistory(history); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/HTPExpressionDatasetAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/HTPExpressionDatasetAnnotationExecutor.java index 9985cc46e..380ccc670 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/HTPExpressionDatasetAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/HTPExpressionDatasetAnnotationExecutor.java @@ -103,8 +103,8 @@ private boolean runLoad(BulkLoadFileHistory history, BackendBulkDataProvider dat } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } updateHistory(history); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java index ee4dc8183..e50c882a6 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java @@ -219,6 +219,7 @@ protected boolean runLoad(BaseUpser protected boolean runLoad(BaseUpsertServiceInterface service, BulkLoadFileHistory history, BackendBulkDataProvider dataProvider, List objectList, List idsAdded, Boolean terminateFailing, String countType, String dataType) { if (Thread.currentThread().isInterrupted()) { + history.setErrorMessage("Thread isInterrupted"); throw new RuntimeException("Thread isInterrupted"); } ProcessDisplayHelper ph = new ProcessDisplayHelper(); @@ -259,6 +260,7 @@ protected boolean runLoad(BaseUpser } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { + history.setErrorMessage("Thread isInterrupted"); throw new RuntimeException("Thread isInterrupted"); } } @@ -276,6 +278,7 @@ protected boolean runLoad(BaseUpser // The following methods are for bulk validation protected > void runCleanup(S service, BulkLoadFileHistory history, String dataProviderName, List annotationIdsBefore, List annotationIdsAfter, String loadTypeString, Boolean deprecate) { if (Thread.currentThread().isInterrupted()) { + history.setErrorMessage("Thread isInterrupted"); throw new RuntimeException("Thread isInterrupted"); } Log.debug("runLoad: After: " + dataProviderName + " " + annotationIdsAfter.size()); @@ -312,6 +315,7 @@ protected boolean runLoad(BaseUpser } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { + history.setErrorMessage("Thread isInterrupted"); throw new RuntimeException("Thread isInterrupted"); } } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java index e5f1186ba..24e4bd8af 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/OntologyExecutor.java @@ -57,7 +57,6 @@ import org.alliancegenome.curation_api.services.processing.LoadProcessDisplayService; import org.alliancegenome.curation_api.util.ProcessDisplayHelper; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import lombok.extern.jbosslog.JBossLog; @@ -275,8 +274,8 @@ private void processTerms(BulkLoadFileHistory bulkLoadFileHistory, OntologyBulkL bulkLoadFileHistory.incrementCompleted(countType); ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + bulkLoadFileHistory.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } ph.finishProcess(); @@ -290,8 +289,8 @@ private void processTerms(BulkLoadFileHistory bulkLoadFileHistory, OntologyBulkL bulkLoadFileHistory.incrementCompleted(countType); ph1.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + bulkLoadFileHistory.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } ph1.finishProcess(); @@ -305,8 +304,8 @@ private void processTerms(BulkLoadFileHistory bulkLoadFileHistory, OntologyBulkL bulkLoadFileHistory.incrementCompleted(countType); ph2.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + bulkLoadFileHistory.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } ph2.finishProcess(); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java index 831fd424e..976975850 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/PhenotypeAnnotationExecutor.java @@ -23,7 +23,6 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -115,8 +114,8 @@ private void loadSecondaryAnnotations(BulkLoadFileHistory history, List objectList, List idsUpdated) { + if (Thread.currentThread().isInterrupted()) { + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); + } + ProcessDisplayHelper ph = new ProcessDisplayHelper(); ph.addDisplayHandler(loadProcessDisplayService); if (CollectionUtils.isNotEmpty(objectList)) { @@ -107,8 +112,8 @@ protected boolean runLoad(BulkLoadFileHistory history, BackendBulkDataProvider d } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } updateHistory(history); @@ -152,8 +157,8 @@ protected void runCleanup(BulkLoadFileHistory history, String dataProviderName, } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } updateHistory(history); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/gff/Gff3CDSExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/gff/Gff3CDSExecutor.java index 08507fa4b..6c6815011 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/gff/Gff3CDSExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/gff/Gff3CDSExecutor.java @@ -29,7 +29,6 @@ import com.fasterxml.jackson.dataformat.csv.CsvParser; import com.fasterxml.jackson.dataformat.csv.CsvSchema; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -153,8 +152,8 @@ private boolean runLoad( } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } updateHistory(history); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/gff/Gff3ExonExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/gff/Gff3ExonExecutor.java index 8a6dd12c6..47edf7b01 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/gff/Gff3ExonExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/gff/Gff3ExonExecutor.java @@ -28,7 +28,6 @@ import com.fasterxml.jackson.dataformat.csv.CsvParser; import com.fasterxml.jackson.dataformat.csv.CsvSchema; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -157,8 +156,8 @@ private boolean runLoad( ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } updateHistory(history); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/gff/Gff3TranscriptExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/gff/Gff3TranscriptExecutor.java index 21104f2eb..a797476c3 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/gff/Gff3TranscriptExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/gff/Gff3TranscriptExecutor.java @@ -28,7 +28,6 @@ import com.fasterxml.jackson.dataformat.csv.CsvParser; import com.fasterxml.jackson.dataformat.csv.CsvSchema; -import io.quarkus.logging.Log; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -154,8 +153,8 @@ private boolean runLoad( } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - Log.info("Thread Interrupted:"); - break; + history.setErrorMessage("Thread isInterrupted"); + throw new RuntimeException("Thread isInterrupted"); } } updateHistory(history); diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/processors/StartLoadProcessor.java b/src/main/java/org/alliancegenome/curation_api/jobs/processors/StartLoadProcessor.java index ba6fcbf6d..2d7c61879 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/processors/StartLoadProcessor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/processors/StartLoadProcessor.java @@ -37,7 +37,9 @@ public void bulkLoadFile(@ObservesAsync StartedLoadJobEvent event) { // An @Obse } catch (Exception e) { endLoad(bulkLoadFileHistory, "Failed loading: " + bulkLoadFileHistory.getBulkLoad().getName() + " please check the logs for more info. " + bulkLoadFileHistory.getErrorMessage(), JobStatus.FAILED); Log.error("Load File: " + bulkLoadFileHistory.getBulkLoad().getName() + " is failed"); - e.printStackTrace(); + if (!bulkLoadFileHistory.getErrorMessage().equals("Thread isInterrupted")) { + e.printStackTrace(); + } } }