More error logging
This commit is contained in:
@@ -13,7 +13,7 @@ import java.util.function.BooleanSupplier;
|
|||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public class ServiceSlice extends TrackedObject {
|
public class ServiceSlice extends TrackedObject {
|
||||||
private final String name;
|
final String name;
|
||||||
final int weightPerJob;
|
final int weightPerJob;
|
||||||
volatile boolean alive = true;
|
volatile boolean alive = true;
|
||||||
private final ServiceThreadPool threadPool;
|
private final ServiceThreadPool threadPool;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package me.cortex.voxy.common.thread;
|
|||||||
import me.cortex.voxy.common.Logger;
|
import me.cortex.voxy.common.Logger;
|
||||||
import me.cortex.voxy.common.util.Pair;
|
import me.cortex.voxy.common.util.Pair;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.concurrent.Semaphore;
|
import java.util.concurrent.Semaphore;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
@@ -204,7 +205,11 @@ public class ServiceThreadPool {
|
|||||||
|
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
if (this.serviceSlices.length != 0) {
|
if (this.serviceSlices.length != 0) {
|
||||||
throw new IllegalStateException("All service slices must be shutdown before thread pool can exit");
|
String remaining = "";
|
||||||
|
for (var service : this.serviceSlices) {
|
||||||
|
remaining += service.name + ", ";
|
||||||
|
}
|
||||||
|
throw new IllegalStateException("All service slices must be shutdown before thread pool can exit. Remaining: " + remaining);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Wait for the tasks to finish
|
//Wait for the tasks to finish
|
||||||
|
|||||||
Reference in New Issue
Block a user