From 2d208de145833d2ac62149b536495db0c5a26101 Mon Sep 17 00:00:00 2001 From: AlexeyAnufriev Date: Thu, 12 Sep 2019 15:21:34 +0200 Subject: [PATCH] Clear connection pool for OkHttpClient Closes gh-23628 --- .../http/client/OkHttp3ClientHttpRequestFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-web/src/main/java/org/springframework/http/client/OkHttp3ClientHttpRequestFactory.java b/spring-web/src/main/java/org/springframework/http/client/OkHttp3ClientHttpRequestFactory.java index a0ca57711e..f23febf88d 100644 --- a/spring-web/src/main/java/org/springframework/http/client/OkHttp3ClientHttpRequestFactory.java +++ b/spring-web/src/main/java/org/springframework/http/client/OkHttp3ClientHttpRequestFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -121,6 +121,7 @@ public class OkHttp3ClientHttpRequestFactory cache.close(); } this.client.dispatcher().executorService().shutdown(); + this.client.connectionPool().evictAll(); } }