Skip to content

Commit

Permalink
Implement Closeable in QSCManager, document exception swallowing
Browse files Browse the repository at this point in the history
Signed-off-by: owenhalpert <[email protected]>
  • Loading branch information
owenhalpert committed Dec 23, 2024
1 parent 1c4b6bf commit 14ed10f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ private void initialize(NativeMemoryCacheManagerDto nativeMemoryCacheDTO) {
try {
cache.cleanUp();
} catch (Exception e) {
// Exceptions from Guava shouldn't halt the executor
logger.error("Error cleaning up cache", e);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ private void buildCache() {
try {
cache.cleanUp();
} catch (Exception e) {
// Exceptions from Guava shouldn't halt the executor
log.error("Error cleaning up cache", e);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import lombok.NoArgsConstructor;
import org.opensearch.knn.index.codec.KNN990Codec.KNN990QuantizationStateReader;

import java.io.Closeable;
import java.io.IOException;

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class QuantizationStateCacheManager {
public final class QuantizationStateCacheManager implements Closeable {

private static volatile QuantizationStateCacheManager instance;

Expand Down Expand Up @@ -80,6 +81,7 @@ public void clear() {
QuantizationStateCache.getInstance().clear();
}

@Override
public void close() throws IOException {
QuantizationStateCache.getInstance().close();
}
Expand Down

0 comments on commit 14ed10f

Please sign in to comment.