diff --git a/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java b/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java index e9458ba..c1d53ee 100644 --- a/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java +++ b/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java @@ -69,6 +69,7 @@ import org.rocksdb.TxnDBWritePolicy; import org.rocksdb.WALRecoveryMode; import org.rocksdb.WriteBufferManager; import org.rocksdb.util.SizeUnit; +import org.warp.commonutils.type.ShortNamedThreadFactory; import reactor.core.publisher.Mono; import reactor.core.scheduler.Scheduler; import reactor.core.scheduler.Schedulers; @@ -257,9 +258,8 @@ public class LLLocalKeyValueDatabase implements LLKeyValueDatabase { } else { this.dbScheduler = Schedulers.newBoundedElastic(threadCap, Schedulers.DEFAULT_BOUNDED_ELASTIC_QUEUESIZE, - "db-" + name, - 60, - true + new ShortNamedThreadFactory("db-" + name).setDaemon(true).withGroup(new ThreadGroup("database-threads")), + 60 ); } } diff --git a/src/main/java/it/cavallium/dbengine/database/disk/LLLocalLuceneIndex.java b/src/main/java/it/cavallium/dbengine/database/disk/LLLocalLuceneIndex.java index c3dc463..f7169a8 100644 --- a/src/main/java/it/cavallium/dbengine/database/disk/LLLocalLuceneIndex.java +++ b/src/main/java/it/cavallium/dbengine/database/disk/LLLocalLuceneIndex.java @@ -70,6 +70,7 @@ import org.apache.lucene.store.MMapDirectory; import org.apache.lucene.util.InfoStream; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.warp.commonutils.type.ShortNamedThreadFactory; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.core.publisher.SignalType; @@ -89,9 +90,8 @@ public class LLLocalLuceneIndex implements LLLuceneIndex { private static final Scheduler luceneHeavyTasksScheduler = uninterruptibleScheduler(Schedulers.newBoundedElastic( DEFAULT_BOUNDED_ELASTIC_SIZE, DEFAULT_BOUNDED_ELASTIC_QUEUESIZE, - "heavy-tasks", - Math.toIntExact(Duration.ofHours(1).toSeconds()), - true + new ShortNamedThreadFactory("heavy-tasks").setDaemon(true).withGroup(new ThreadGroup("lucene-heavy-tasks")), + Math.toIntExact(Duration.ofHours(1).toSeconds()) )); private static final Scheduler bulkScheduler = uninterruptibleScheduler(Schedulers.boundedElastic());