Skip to content

Commit 1a88678

Browse files
committed
Log warning when threadpool for cache maintenance is null
Signed-off-by: owenhalpert <ohalpert@gmail.com>
1 parent a7e5ff4 commit 1a88678

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/main/java/org/opensearch/knn/index/memory/NativeMemoryCacheManager.java

+3
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ private void initialize(NativeMemoryCacheManagerDto nativeMemoryCacheDTO) {
110110
cacheCapacityReached = new AtomicBoolean(false);
111111
accessRecencyQueue = new ConcurrentLinkedDeque<>();
112112
cache = cacheBuilder.build();
113+
113114
if (threadPool != null) {
114115
startMaintenance(cache);
116+
} else {
117+
logger.warn("ThreadPool is null during NativeMemoryCacheManager initialization. Maintenance will not be started.");
115118
}
116119
}
117120

src/main/java/org/opensearch/knn/quantization/models/quantizationState/QuantizationStateCache.java

+3
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@ private void buildCache() {
7878
)
7979
.removalListener(this::onRemoval)
8080
.build();
81+
8182
if (threadPool != null) {
8283
startMaintenance(cache);
84+
} else {
85+
log.warn("ThreadPool is null during QuantizationStateCache initialization. Maintenance will not be started.");
8386
}
8487
}
8588

0 commit comments

Comments
 (0)