Skip to content
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

[Java] Automatically clean up temp files. #5507

Merged
merged 8 commits into from
Aug 24, 2019

Conversation

raulchen
Copy link
Contributor

Why are these changes needed?

Previously, we depends on File::deleteOnExit to delete temp files. This way sometimes cannot work if the JVM doesn't exit gracefully. This issue may lead to eating up disk space.

What do these changes do?

  • This PR removes the temp files right after using it.
  • Also remove some unused Java code.

Related issue number

Linter

  • I've run scripts/format.sh to lint the changes in this PR.

Copy link
Member

@kfstorm kfstorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!

return false;
@Override
public void close() {
Preconditions.checkState(file.delete(), "Couldn't delete file {}", file.getAbsolutePath());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer a warning message instead of a check here.

startProcess(command, null, "raylet");
try (FileUtil.TempFile rayletFile = FileUtil.getTempFileFromResource("raylet")) {
rayletFile.getFile().setExecutable(true);
List<String> command = ImmutableList.of(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that CI isn't able to catch this!

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/16457/
Test PASSed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/16459/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/16490/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/16495/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/16500/
Test FAILed.

@jovany-wang jovany-wang merged commit fab5ae6 into ray-project:master Aug 24, 2019
@jovany-wang jovany-wang deleted the java_rm_temp_file branch August 24, 2019 09:20
kfstorm added a commit to antgroup/ant-ray that referenced this pull request Aug 27, 2019
kfstorm added a commit to antgroup/ant-ray that referenced this pull request Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants