Skip to content

Commit

Permalink
[#3960]fix vertx close may block shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
liubao68 committed Oct 10, 2023
1 parent 863e887 commit 0be5c46
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
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;
Expand All @@ -44,6 +43,7 @@
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;
Expand Down Expand Up @@ -192,7 +192,7 @@ public static CompletableFuture<Void> closeVertxByName(String name) {
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);
}
Expand All @@ -211,8 +211,8 @@ public static void blockCloseVertx(Vertx vertx) {
});

try {
latch.await();
} catch (InterruptedException e) {
latch.await(30, TimeUnit.SECONDS);
} catch (Throwable e) {
LOGGER.info("Failed to wait close vertx {}.", vertx);
}
}
Expand Down

0 comments on commit 0be5c46

Please sign in to comment.