aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2021-06-01 21:32:57 +0100
committerLuck <git@lucko.me>2021-06-01 21:32:57 +0100
commit6771fd491b2d971c6e97429139cb9d6558a59ccc (patch)
tree25e9c54d513ee4617adb1d6d18376100a255c39c /spark-common/src/main/java/me/lucko/spark
parentc4e8ab0dad45fe33bff89930ad76bac4d2854133 (diff)
downloadspark-6771fd491b2d971c6e97429139cb9d6558a59ccc.tar.gz
spark-6771fd491b2d971c6e97429139cb9d6558a59ccc.tar.bz2
spark-6771fd491b2d971c6e97429139cb9d6558a59ccc.zip
Close okhttp threads on shutdown
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/SparkPlatform.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/SparkPlatform.java b/spark-common/src/main/java/me/lucko/spark/common/SparkPlatform.java
index fdced75..4dfbd20 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/SparkPlatform.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/SparkPlatform.java
@@ -160,6 +160,11 @@ public class SparkPlatform {
}
SparkApi.unregister();
+
+ // shutdown okhttp
+ // see: https://github.com/square/okhttp/issues/4029
+ OK_HTTP_CLIENT.dispatcher().executorService().shutdown();
+ OK_HTTP_CLIENT.connectionPool().evictAll();
}
public SparkPlugin getPlugin() {