diff --git a/CHANGELOG.md b/CHANGELOG.md index a3a4108253..5999e870a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ and what APIs have changed, if applicable. ## [Unreleased] +## [29.65.7] - 2025-04-02 +- Fix a corner case bug in d2ClientBuilder shutdown logic. + ## [29.65.6] - 2025-03-26 - Change log level of ads stream closure from err to warn @@ -5795,7 +5798,8 @@ patch operations can re-use these classes for generating patch messages. ## [0.14.1] -[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.65.6...master +[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.65.7...master +[29.65.7]: https://github.com/linkedin/rest.li/compare/v29.65.6...v29.65.7 [29.65.6]: https://github.com/linkedin/rest.li/compare/v29.65.5...v29.65.6 [29.65.5]: https://github.com/linkedin/rest.li/compare/v29.65.4...v29.65.5 [29.65.4]: https://github.com/linkedin/rest.li/compare/v29.65.3...v29.65.4 diff --git a/d2/src/main/java/com/linkedin/d2/balancer/D2ClientBuilder.java b/d2/src/main/java/com/linkedin/d2/balancer/D2ClientBuilder.java index ef558bd486..57d2e3e889 100644 --- a/d2/src/main/java/com/linkedin/d2/balancer/D2ClientBuilder.java +++ b/d2/src/main/java/com/linkedin/d2/balancer/D2ClientBuilder.java @@ -886,17 +886,33 @@ public void shutdown(Callback callback) @Override public void onError(Throwable e) { - _executors.forEach(ExecutorService::shutdown); + shutdownExecutorServices(); callback.onError(e); } @Override public void onSuccess(None result) { - _executors.forEach(ExecutorService::shutdown); + shutdownExecutorServices(); callback.onSuccess(result); } }); } + + private void shutdownExecutorServices() + { + for (ExecutorService executor : _executors) + { + if (executor.isShutdown()) + { + LOG.warn("Executor is already shut down"); + } + else + { + LOG.info("Shutting down executor"); + executor.shutdown(); + } + } + } } } diff --git a/gradle.properties b/gradle.properties index 9c1e6ceef9..ebe4df6370 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=29.65.6 +version=29.65.7 group=com.linkedin.pegasus org.gradle.configureondemand=true org.gradle.parallel=true