New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete the temp directories created while forking #6358
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6358 +/- ##
=========================================
Coverage 72.97% 72.97%
- Complexity 35133 35134 +1
=========================================
Files 2829 2829
Lines 142698 142700 +2
Branches 17148 17148
=========================================
+ Hits 104134 104140 +6
+ Misses 30335 30332 -3
+ Partials 8229 8228 -1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ratulm and @sfraint)
projects/coordinator/src/main/java/org/batfish/coordinator/WorkMgr.java, line 1549 at r1 (raw file):
// do not need this directory anymore CommonUtil.deleteDirectory(unzipDir);
FYI CommonUtil.createTempDirectory
calls:
tempDir.toFile().deleteOnExit();
I hope the explicit deletion does not interfere.
projects/coordinator/src/main/java/org/batfish/coordinator/WorkMgr.java, line 1598 at r1 (raw file):
throw new BatfishException(String.format("Error forking snapshot: %s", e.getMessage()), e); } finally { CommonUtil.deleteDirectory(newSnapshotInputsDir);
Just use FileUtils.deleteDirectory
in both places. This function already throws IOException
. No new BatfishException
s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ratulm and @sfraint)
projects/coordinator/src/main/java/org/batfish/coordinator/WorkMgr.java, line 1596 at r1 (raw file):
baseSnapshotId); } catch (Exception e) { throw new BatfishException(String.format("Error forking snapshot: %s", e.getMessage()), e);
We really need to clean up these exceptions.
FWICT e
can be narrowed to BatfishException | UncheckedIOException
.
Eventually we should get rid of BatfishException
. I'd prefer you didn't throw a new one here, but you can defer fixing that until initSnapshot
exceptions are improved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @arifogel and @sfraint)
projects/coordinator/src/main/java/org/batfish/coordinator/WorkMgr.java, line 1549 at r1 (raw file):
Previously, arifogel (Ari Fogel) wrote…
FYI
CommonUtil.createTempDirectory
calls:tempDir.toFile().deleteOnExit();
I hope the explicit deletion does not interfere.
I don't think it does, and we are using this pattern in upload snapshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @sfraint)
No description provided.