- Try to get the cause of the exception of the callable-tasks which handle parquet-files.

- Update License.
- Update dependencies.
This commit is contained in:
Lampros Smyrnaios 2024-02-07 18:34:28 +02:00
parent 34d7a143e7
commit 3563fd6e2a
6 changed files with 17 additions and 7 deletions

View File

@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2021-2023 Athena Research and Innovation Center (ARC)
Copyright 2021-2024 OpenAIRE AMKE
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -110,7 +110,7 @@ dependencies {
// Add back some updated version of the needed dependencies.
implementation 'org.apache.thrift:libthrift:0.17.0' // Newer versions (>=0.18.X) are not compatible with JAVA 8.
implementation 'com.fasterxml.woodstox:woodstox-core:6.5.1'
implementation 'com.fasterxml.woodstox:woodstox-core:6.6.0'
// https://mvnrepository.com/artifact/org.json/json
implementation 'org.json:json:20231013'

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

View File

@ -26,7 +26,7 @@ if [[ justRun -eq 1 && shouldRunInDocker -eq 1 ]]; then
justRun=0
fi
gradleVersion="8.5"
gradleVersion="8.6"
if [[ justRun -eq 0 ]]; then

View File

@ -112,7 +112,7 @@ public class ScheduledTasks {
if ( ! future.get() ) // Get and see if an exception is thrown. This blocks the current thread, until the task of the future has finished.
numFailedTasks ++;
} catch (ExecutionException ee) { // These can be serious errors like an "out of memory exception" (Java HEAP).
// The stacktrace of the "ExecutionException" is the one of thi code and not the code which ran inside the background-task. Try to get the cause.
// The stacktrace of the "ExecutionException" is the one of the current code and not the code which ran inside the background-task. Try to get the cause.
Throwable throwable = ee.getCause();
if ( throwable == null ) {
logger.warn("No cause was retrieved for the \"ExecutionException\"!");
@ -308,7 +308,7 @@ public class ScheduledTasks {
} // Any error is already logged.
// TODO - Export more complex data; <numOfAllPayloadsPerDatasource>, <numOfAllPayloadsPerYear>,
// TODO - Export more complex data; <numOfAllPayloadsPerDatasource>, <numOfAllPayloadsPerPublicationYear>,
// <numOfAggregatedPayloadsPerDatasource>, ..., <numOfBulkImportedPayloadsPerDatasource>, ...
}

View File

@ -43,6 +43,7 @@ import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.stream.Collectors;
@ -700,7 +701,16 @@ public class ParquetFileUtils {
return new SumParquetSuccess(false, false, ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errMsg));
}
} catch (Exception e) {
logger.error("", e);
Throwable throwable = e;
if ( e instanceof ExecutionException ) {
// The stacktrace of the "ExecutionException" is the one of the current code and not the code which ran inside the background-task. Try to get the cause.
throwable = e.getCause();
if ( throwable == null ) {
logger.warn("No cause was retrieved for the \"ExecutionException\"!");
throwable = e;
}
}
logger.error("", throwable);
// We do not know if the failed "future" refers to a "payload" or to a "attempt".
// So we cannot increase a specific counter. That's ok, the only drawback if that we may try to "load" the non-existent data and get an exception.
}