{"record":{"id":"f1a63b2f43ea631e","repo":"apache/cassandra","slug":"throttling-file-deletion-waited-seconds-to-del","errorCode":null,"errorMessage":"Throttling file deletion: waited {} seconds to delete {}","messagePattern":"Throttling file deletion: waited (.+?) seconds to delete (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/java/org/apache/cassandra/io/util/PathUtils.java","lineNumber":320,"sourceCode":"        try\n        {\n            Files.delete(file);\n            onDeletion.accept(file);\n            return true;\n        }\n        catch (IOException e)\n        {\n            return false;\n        }\n    }\n\n    public static void delete(Path file, @Nullable RateLimiter rateLimiter)\n    {\n        if (rateLimiter != null)\n        {\n            double throttled = rateLimiter.acquire();\n            if (throttled > 0.0)\n                nospam1m.warn(\"Throttling file deletion: waited {} seconds to delete {}\", throttled, file);\n        }\n        delete(file);\n    }\n\n    public static Throwable delete(Path file, Throwable accumulate, @Nullable RateLimiter rateLimiter)\n    {\n        try\n        {\n            delete(file, rateLimiter);\n        }\n        catch (Throwable t)\n        {\n            accumulate = merge(accumulate, t);\n        }\n        return accumulate;\n    }\n\n    /**","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/util/PathUtils.java#L302-L338","documentation":"When file deletions are rate-limited (RateLimiter), PathUtils.delete acquires a permit before unlinking; if the limiter made the thread wait, it logs a spam-limited warning reporting how many seconds the delete was throttled and which path.","triggerScenarios":"Deleting files via PathUtils.delete(path, rateLimiter) when the deletion rate exceeds the configured limiter rate, causing blocking waits (typically during large cleanup/compaction bursts).","commonSituations":"Large compaction or snapshot teardown on slow disks with a low deletion rate limit; GC-unfriendly deletion storms being deliberately throttled.","solutions":["Tune cassandra.yaml disk_optimization_strategy / deletion rate-related settings or the RateLimiter rate to match disk capability","Treat as informational unless deletion lag causes disk space pressure","Increase the limit if disk space is filling faster than files are deleted","Schedule heavy cleanup during off-peak hours"],"exampleFix":"null","handlingStrategy":"fallback","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n    PathUtils.delete(file, rateLimiter);\n} catch (IOException e) { /* deletion failed after throttling; handle */ }\n// expect the throttling warn log when waits exceed 0","preventionTips":["Configure the deletion rate limiter to match disk IOPS","Watch deletion throughput during big cleanup operations","Free space proactively; do not rely on deletes outpacing writes","Schedule heavy deletion during low-traffic windows"],"tags":["io","filesystem","delete","throttling"],"backgroundTag":"rate-limit-exceeded","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"}