Skip to content

Commit

Permalink
[flink] wait executors shutdown to avoid test break (#2245)
Browse files Browse the repository at this point in the history
  • Loading branch information
leaves12138 authored Nov 2, 2023
1 parent f7ebb84 commit 56bb714
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

/**
Expand Down Expand Up @@ -129,6 +130,10 @@ void shutdown() throws Exception {
if (lazyCompactExecutor != null) {
// ignore runnable tasks in queue
lazyCompactExecutor.shutdownNow();
if (!lazyCompactExecutor.awaitTermination(120, TimeUnit.SECONDS)) {
LOG.warn(
"Executors shutdown timeout, there may be some files aren't deleted correctly");
}
List<CommitMessage> messages = new ArrayList<>();
for (Future<CommitMessage> resultFuture : result) {
if (!resultFuture.isDone()) {
Expand Down

0 comments on commit 56bb714

Please sign in to comment.