Skip to content

Commit

Permalink
use daemon thread for schedule in jmx-metrics BeanFinder
Browse files Browse the repository at this point in the history
  • Loading branch information
lizongwu committed May 11, 2024
1 parent 48d4c13 commit fad1362
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ class BeanFinder {

private final MetricRegistrar registrar;
private MetricConfiguration conf;
private final ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor();
private final ScheduledExecutorService exec =
Executors.newSingleThreadScheduledExecutor(
runnable -> {
Thread result = new Thread(runnable, "jmx_bean_finder");
result.setDaemon(true);
return result;
});
private final long discoveryDelay;
private final long maxDelay;
private long delay = 1000; // number of milliseconds until first attempt to discover MBeans
Expand Down

0 comments on commit fad1362

Please sign in to comment.