diff options
author | Luck <git@lucko.me> | 2021-06-01 21:32:57 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2021-06-01 21:32:57 +0100 |
commit | 6771fd491b2d971c6e97429139cb9d6558a59ccc (patch) | |
tree | 25e9c54d513ee4617adb1d6d18376100a255c39c /spark-common/src/main/java/me/lucko/spark | |
parent | c4e8ab0dad45fe33bff89930ad76bac4d2854133 (diff) | |
download | spark-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.java | 5 |
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() { |