Skip to content

Commit

Permalink
Fix threadpool monitor when using virtual thread (#1344)
Browse files Browse the repository at this point in the history
Signed-off-by: JermaineHua <[email protected]>
  • Loading branch information
CrazyHZM authored Sep 25, 2024
1 parent 5ca7e69 commit d285ec4
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor;

/**
Expand Down Expand Up @@ -275,9 +276,14 @@ private void startCustomThreadPoolMonitor() {
} else {
customThreadPoolMonitor.setPoolName(pool.getThreadPoolName());
}
customThreadPoolMonitor.setThreadPoolExecutor(pool.getExecutor());
customThreadPoolMonitor.start();
poolNames.add(pool.getThreadPoolName());

Executor tmp = pool.getUserExecutor();
if (tmp instanceof ThreadPoolExecutor) {
customThreadPoolMonitor.setThreadPoolExecutor((ThreadPoolExecutor) pool
.getUserExecutor());
customThreadPoolMonitor.start();
poolNames.add(pool.getThreadPoolName());
}
}
}
}
Expand Down

0 comments on commit d285ec4

Please sign in to comment.