From 5f75b48e95cbf4f96fefe48d52724691e28a79ad Mon Sep 17 00:00:00 2001 From: LSmyrnaios Date: Mon, 22 May 2023 21:33:02 +0300 Subject: [PATCH] - Increase the "read-timeout" when searching for the host's machine public-IP. - Update dependencies. - Code polishing. --- build.gradle | 10 +++++----- .../urls_controller/controllers/GeneralController.java | 2 -- .../urls_controller/services/UrlsServiceImpl.java | 3 +-- .../eu/openaire/urls_controller/util/UriBuilder.java | 4 ++-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 80a5376..ecb4e14 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'org.springframework.boot' version '2.7.11' + id 'org.springframework.boot' version '2.7.12' id 'io.spring.dependency-management' version '1.1.0' id 'java' } @@ -51,7 +51,7 @@ dependencies { // https://mvnrepository.com/artifact/org.apache.commons/commons-compress implementation 'org.apache.commons:commons-compress:1.23.0' - implementation 'io.minio:minio:8.5.2' + implementation 'io.minio:minio:8.5.3' // https://mvnrepository.com/artifact/com.cloudera.impala/jdbc implementation("com.cloudera.impala:jdbc:2.5.31") { @@ -74,7 +74,7 @@ dependencies { } // https://mvnrepository.com/artifact/org.apache.parquet/parquet-avro - implementation('org.apache.parquet:parquet-avro:1.13.0') + implementation('org.apache.parquet:parquet-avro:1.13.1') // https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-common implementation('org.apache.hadoop:hadoop-common:3.3.5') { @@ -107,7 +107,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.0' + implementation 'com.fasterxml.woodstox:woodstox-core:6.5.1' // https://mvnrepository.com/artifact/org.json/json implementation 'org.json:json:20230227' @@ -117,7 +117,7 @@ dependencies { // https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus - runtimeOnly 'io.micrometer:micrometer-registry-prometheus:1.10.6' + runtimeOnly 'io.micrometer:micrometer-registry-prometheus:1.11.0' testImplementation 'org.springframework.security:spring-security-test' testImplementation "org.springframework.boot:spring-boot-starter-test" diff --git a/src/main/java/eu/openaire/urls_controller/controllers/GeneralController.java b/src/main/java/eu/openaire/urls_controller/controllers/GeneralController.java index 8050c21..bbd1909 100644 --- a/src/main/java/eu/openaire/urls_controller/controllers/GeneralController.java +++ b/src/main/java/eu/openaire/urls_controller/controllers/GeneralController.java @@ -16,9 +16,7 @@ public class GeneralController { @GetMapping("isAlive") public ResponseEntity isControllerAlive() { - logger.info("Received an \"isAlive\" request."); - return ResponseEntity.ok().build(); } diff --git a/src/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java b/src/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java index a47e008..7dbb969 100644 --- a/src/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java +++ b/src/main/java/eu/openaire/urls_controller/services/UrlsServiceImpl.java @@ -306,9 +306,8 @@ public class UrlsServiceImpl implements UrlsService { ImpalaConnector.databaseLock.lock(); String assignmentErrorMsg = deleteWorkerAssignments(curWorkerId); ImpalaConnector.databaseLock.unlock(); - if ( assignmentErrorMsg != null ) { + if ( assignmentErrorMsg != null ) errorMsg += "\n" + assignmentErrorMsg; - } logger.error(errorMsg); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(errorMsg); } catch (Exception e) { diff --git a/src/main/java/eu/openaire/urls_controller/util/UriBuilder.java b/src/main/java/eu/openaire/urls_controller/util/UriBuilder.java index 4060f48..67a0255 100644 --- a/src/main/java/eu/openaire/urls_controller/util/UriBuilder.java +++ b/src/main/java/eu/openaire/urls_controller/util/UriBuilder.java @@ -58,8 +58,8 @@ public class UriBuilder { String urlString = "https://api.ipify.org/"; try { conn = (HttpURLConnection) new URL(urlString).openConnection(); - conn.setConnectTimeout(60_000); - conn.setReadTimeout(60_000); + conn.setConnectTimeout(60_000); // 1 minute + conn.setReadTimeout(120_000); // 2 minutes conn.setRequestMethod("GET"); conn.connect();