{"record":{"id":"6c3b1fd6a11f0d7b","repo":"apache/cassandra","slug":"failed-to-close-compressiondictionarymanager-on-di","errorCode":null,"errorMessage":"Failed to close CompressionDictionaryManager on disabling dictionary-based compression for table {}.{}","messagePattern":"Failed to close CompressionDictionaryManager on disabling dictionary-based compression for table (.+?)\\.(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/compression/CompressionDictionaryManager.java","lineNumber":132,"sourceCode":"        this.compressionParams = newParams;\n        this.isEnabled = compressionParams.isDictionaryCompressionEnabled();\n        this.kind = compressionParams.getCompressionDictionaryKind();\n        scheduler.setEnabled(isEnabled);\n        if (isEnabled)\n        {\n            registerMbean();\n            scheduler.scheduleRefreshTask();\n            return;\n        }\n\n        // Clean up when dictionary compression is disabled\n        try\n        {\n            close();\n        }\n        catch (Exception e)\n        {\n            logger.warn(\"Failed to close CompressionDictionaryManager on disabling \" +\n                        \"dictionary-based compression for table {}.{}\", keyspaceName, tableName);\n        }\n    }\n\n    @Nullable\n    @Override\n    public CompressionDictionary getCurrent()\n    {\n        return cache.getCurrent();\n    }\n\n    @Override\n    public CompressionDictionary get(CompressionDictionary.DictId dictId)\n    {\n        return cache.get(dictId);\n    }\n\n    @Override","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/compression/CompressionDictionaryManager.java#L114-L150","documentation":"When schema changes disable dictionary-based compression for a table, CompressionDictionaryManager.maybeReloadFromSchema calls close() to tear down trainer/scheduler/cache. If close() throws, it logs this warning naming the table; the schema change continues but dictionary resources (threads, cache refs) may leak.","triggerScenarios":"ALTER TABLE ... WITH compression = {...non-dictionary...} (or dropping the table) triggers maybeReloadFromSchema to disable the manager, and close() throws an exception; observed while testing enable/disable of dictionary compression.","commonSituations":"Repeatedly toggling dictionary compression in tests; disabling compression while a training run or cache eviction is in flight; scheduler thread refusing to shut down cleanly.","solutions":["Check surrounding log lines for the close() root cause (usually from CompressionDictionaryManager 'Failed closing ...').","Avoid rapid disable/enable toggling; allow in-flight training/refresh to finish before altering compression.","Restart the node if leaked scheduler threads/cache refs accumulate, then re-apply the compression change.","If reproducible, capture the exception and file a fix for closeQuietly swallowing details."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { manager.close(); } catch (Exception e) { log.warn(\"dictionary manager close failed; resources may leak\", e); }","preventionTips":["Serialize compression ALTERs; avoid concurrent enable/disable cycles.","Let in-flight training complete before disabling dictionary compression."],"tags":["compression","schema-change","resource-cleanup","lifecycle"],"backgroundTag":"resource-cleanup-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}