This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch 2.8.x
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/2.8.x by this push:
new 4f59e71f5 [#3960]fix vertx close may block shutdown (#3965)
4f59e71f5 is described below
commit 4f59e71f5607b642f38fe07172d2c8a3acffe218
Author: liubao68 <[email protected]>
AuthorDate: Tue Oct 10 11:16:11 2023 +0800
[#3960]fix vertx close may block shutdown (#3965)
---
.../java/org/apache/servicecomb/foundation/vertx/VertxUtils.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/VertxUtils.java
b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/VertxUtils.java
index a3f7efa42..5cc68f13d 100644
---
a/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/VertxUtils.java
+++
b/foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/VertxUtils.java
@@ -25,7 +25,6 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import io.vertx.core.file.impl.FileResolverImpl;
import org.apache.commons.io.IOUtils;
import org.apache.servicecomb.foundation.common.Holder;
import org.apache.servicecomb.foundation.common.concurrent.ConcurrentHashMapEx;
@@ -44,6 +43,7 @@ import io.vertx.core.Verticle;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.buffer.Buffer;
+import io.vertx.core.file.impl.FileResolverImpl;
import io.vertx.core.impl.VertxBuilder;
import io.vertx.core.impl.VertxThread;
import io.vertx.core.spi.VertxThreadFactory;
@@ -192,7 +192,7 @@ public final class VertxUtils {
public static void blockCloseVertxByName(String name) {
CompletableFuture<Void> future = closeVertxByName(name);
try {
- future.get();
+ future.get(30, TimeUnit.SECONDS);
} catch (Throwable e) {
LOGGER.error("Failed to wait close vertx {}.", name, e);
}
@@ -211,8 +211,8 @@ public final class VertxUtils {
});
try {
- latch.await();
- } catch (InterruptedException e) {
+ latch.await(30, TimeUnit.SECONDS);
+ } catch (Throwable e) {
LOGGER.info("Failed to wait close vertx {}.", vertx);
}
}