Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/sqlancer/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,11 @@ private String formatInteger(long intValue) {
}
}

ExecutorService execService = Executors.newFixedThreadPool(options.getNumberConcurrentThreads());
ExecutorService execService = Executors.newFixedThreadPool(options.getNumberConcurrentThreads(), r -> {
Thread t = new Thread(r);
t.setDaemon(true);
return t;
});
DBMSExecutorFactory<?, ?, ?> executorFactory = nameToProvider.get(jc.getParsedCommand());

if (options.performConnectionTest()) {
Expand Down Expand Up @@ -716,6 +720,7 @@ private boolean run(MainOptions options, ExecutorService execService,
execService.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);
} else {
execService.awaitTermination(options.getTimeoutSeconds(), TimeUnit.SECONDS);
execService.shutdownNow();
}
} catch (InterruptedException e) {
e.printStackTrace();
Expand Down Expand Up @@ -783,7 +788,11 @@ private static synchronized void startProgressMonitor() {
} else {
progressMonitorStarted = true;
}
final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1, r -> {
Thread t = new Thread(r, "SQLancer-progress-monitor");
t.setDaemon(true);
return t;
});
scheduler.scheduleAtFixedRate(new Runnable() {

private long timeMillis = System.currentTimeMillis();
Expand Down
Loading