apache/cassandra · warning

Failed to close ZstdDictDecompress

Error message

Failed to close ZstdDictDecompress

What it means

Logged in the same tidy path as the compress-side warning, but for ZstdDictDecompress: closing the per-thread decompression zstd native dictionary threw. As with 2841, the exception is swallowed so the remainder of the close sequence completes, but the native decompression dictionary may not have been released.

Solutions

  1. Single warnings are benign; correlate with native memory metrics before investigating.
  2. Check that no stale/mismatched libzstd is loaded (LD_LIBRARY_PATH) conflicting with Cassandra's bundled zstd.
  3. Reduce rapid dictionary churn (aggressive dictionary training cadence) if warnings recur under compaction load.
  4. If leaks persist, restart the node and report to the project with logs.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    decompressDict.close();
} catch (Exception e) {
    logger.warn("Failed to close ZstdDictDecompress", e); // swallow, continue cleanup
}

Prevention

When it happens

Trigger: A compression dictionary instance is being disposed (sstable deletion, table drop, dictionary churn during compaction) and decompressDict.close() throws on the native handle; double-close or use-after-free of the zstd buffer.

Common situations: Compaction removing sstables that used trained zstd dictionaries; dropping tables; node decommission that discards dictionary-backed sstables; observing rising native (non-heap) memory after repeated warnings.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/9959905ae859dd85. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/db/compression/ZstdCompressionDictionary.java:296

                catch (Exception e)
                {
                    // Log but don't fail - continue closing other resources
                    logger.warn("Failed to close ZstdDictCompress", e);
                }
            }
            zstdDictCompressPerLevel.clear();

            // Close decompression dictionary
            ZstdDictDecompress decompressDict = dictDecompress.get();
            if (decompressDict != null)
            {
                try
                {
                    decompressDict.close();
                }
                catch (Exception e)
                {
                    logger.warn("Failed to close ZstdDictDecompress", e);
                }
                dictDecompress.set(null);
            }
        }

        @Override
        public String name()
        {
            return ZstdCompressionDictionary.class.getSimpleName();
        }
    }
}

View on GitHub (pinned to 88fd0f6a0e)