Github user zd-project commented on a diff in the pull request:
https://github.com/apache/storm/pull/2788#discussion_r207376890
--- Diff:
storm-webapp/src/main/java/org/apache/storm/daemon/logviewer/utils/DirectoryCleaner.java
---
@@ -133,10 +123,15 @@ public int compare(File f1, File f2) {
}
while (!stack.isEmpty() && toDeleteSize > 0) {
File file = stack.pop();
- toDeleteSize -= file.length();
- LOG.info("Delete file: {}, size: {}, lastModified: {}",
file.getCanonicalPath(), file.length(), file.lastModified());
- file.delete();
- deletedFiles++;
+ final String canonicalPath = file.getCanonicalPath();
+ final long fileSize = file.length();
+ final long lastModified = file.lastModified();
+ //Original implementation doesn't actually check if delete
succeeded or not.
+ if (file.delete()) {
--- End diff --
I'm wondering if we should use forcedelete here directly?
---