apache/cassandra · warning

Failed closing

Error message

Failed closing {}

What it means

FileUtils.closeQuietly(Closeable) swallows any exception thrown while closing a stream or channel, logging a warning with the object that failed to close. The operation continues because close failures during cleanup are usually non-fatal.

Solutions

  1. Check the log for the preceding root cause (often disk full or I/O error) and fix that first
  2. Ensure resources are closed once via try-with-resources instead of manual close
  3. Verify filesystem health (dmesg, df) if close failures recur
  4. If data loss is a concern, re-run the operation (compaction, streaming) that owned the resource

Example fix

null
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

try {
    FileUtils.closeQuietly(stream);
} catch (Throwable t) { /* closeQuietly never throws; rely on its warn log for diagnosis */ }
// For resources whose close errors matter:
try { stream.close(); } catch (IOException e) { handle(e); }

Prevention

When it happens

Trigger: Any code path calling FileUtils.closeQuietly(...) where the underlying close() throws (e.g. IOException flushing buffered data, already-closed stream, disk I/O error on close).

Common situations: Disk-full conditions while flushing a compaction writer; interrupted or failed sstable writes being cleaned up; double-close of a stream.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/io/util/FileUtils.java:253

        {
            channel.truncate(size);
        }
        catch (IOException e)
        {
            throw PathUtils.propagateUnchecked(e, file.toPath(), true);
        }
    }

    public static void closeQuietly(Closeable c)
    {
        try
        {
            if (c != null)
                c.close();
        }
        catch (Exception e)
        {
            logger.warn("Failed closing {}", c, e);
        }
    }

    public static void closeQuietly(AutoCloseable c)
    {
        try
        {
            if (c != null)
                c.close();
        }
        catch (Exception e)
        {
            logger.warn("Failed closing {}", c, e);
        }
    }

    public static void close(Closeable... cs) throws IOException
    {

View on GitHub (pinned to 88fd0f6a0e)