From 17f887b075a7fa9f60ad56b3dd215a37329cab7c Mon Sep 17 00:00:00 2001 From: John Leacox Date: Wed, 23 Oct 2024 16:30:59 -0500 Subject: [PATCH] Validate idle connections after 2 seconds of inactivity (#90) --- CHANGELOG.md | 3 +++ .../b2/client/webApiHttpClient/HttpClientFactoryImpl.java | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cf98d83e..faa50e51c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ * Fixed `B2StorageClient.deleteAllFilesInBucket` so it uses `fileVersions` instead of `fileNames`. * Added `maxEventsPerBatch` field to `B2WebhookConfiguration`. +### Changed +* Validate idle connections after 2 seconds of inactivity + ## [6.2.1] - 2024-07-16 ### Added * Added `eventId` field to `B2EventNotificationEvent`. diff --git a/httpclient/src/main/java/com/backblaze/b2/client/webApiHttpClient/HttpClientFactoryImpl.java b/httpclient/src/main/java/com/backblaze/b2/client/webApiHttpClient/HttpClientFactoryImpl.java index 766f891d4..141305121 100644 --- a/httpclient/src/main/java/com/backblaze/b2/client/webApiHttpClient/HttpClientFactoryImpl.java +++ b/httpclient/src/main/java/com/backblaze/b2/client/webApiHttpClient/HttpClientFactoryImpl.java @@ -207,6 +207,7 @@ private HttpClientConnectionManager createConnectionManager() { final PoolingHttpClientConnectionManager mgr = new PoolingHttpClientConnectionManager(registry); mgr.setMaxTotal(maxTotalConnectionsInPool); mgr.setDefaultMaxPerRoute(maxConnectionsPerRoute); + mgr.setValidateAfterInactivity(2000); return mgr; } }