From 0b54e68b7bb99c33143abb5eb56baf2231811813 Mon Sep 17 00:00:00 2001 From: Juan Camilo Rada Mesa Date: Mon, 29 Jan 2024 21:50:05 -0500 Subject: [PATCH 1/2] enable borrow --- .../ftp-webclient/src/main/kotlin/ebi/ac/uk/ftp/FTPClientPool.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ftp-webclient/src/main/kotlin/ebi/ac/uk/ftp/FTPClientPool.kt b/client/ftp-webclient/src/main/kotlin/ebi/ac/uk/ftp/FTPClientPool.kt index 817d79472..43029c80a 100644 --- a/client/ftp-webclient/src/main/kotlin/ebi/ac/uk/ftp/FTPClientPool.kt +++ b/client/ftp-webclient/src/main/kotlin/ebi/ac/uk/ftp/FTPClientPool.kt @@ -81,6 +81,7 @@ internal class FTPClientPool( val factory = FTPClientFactory(ftpUser, ftpPassword, ftpUrl, ftpPort) var connections = GenericObjectPool(factory) connections.minIdle = MIN_CONNECTION + connections.testOnBorrow = true return connections } } From 4d49af1e00879b5e33baa13789e8a49a523b9cd8 Mon Sep 17 00:00:00 2001 From: Jhoan Munoz Date: Tue, 30 Jan 2024 18:09:27 +0000 Subject: [PATCH 2/2] Pivotal ID # 186941052: Check FTP Connections Before Borrow Improve exception logging --- .../src/main/kotlin/ebi/ac/uk/ftp/FTPClientPool.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ftp-webclient/src/main/kotlin/ebi/ac/uk/ftp/FTPClientPool.kt b/client/ftp-webclient/src/main/kotlin/ebi/ac/uk/ftp/FTPClientPool.kt index bb914830a..4e531742e 100644 --- a/client/ftp-webclient/src/main/kotlin/ebi/ac/uk/ftp/FTPClientPool.kt +++ b/client/ftp-webclient/src/main/kotlin/ebi/ac/uk/ftp/FTPClientPool.kt @@ -71,8 +71,8 @@ internal class FTPClientPool( val ftpClient = p.`object` return try { ftpClient.sendNoOp() - } catch (e: Exception) { - logger.error(e) { "Error checking ftp connection" } + } catch (exception: Exception) { + logger.error { "Error checking ftp connection: ${ exception.localizedMessage }" } false } }