-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[FLINK-32974][client] Avoid creating a new temporary directory every time for RestClusterClient #23363
Conversation
Hi @zentol , could you help to review this PR? |
925630d
to
b7541ba
Compare
Files.createDirectories( | ||
Paths.get( | ||
ConfigurationUtils.parseTempDirectories(config)[0], | ||
"flink-rest-client-jobgraphs"))); |
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.
Looks to me there's no need to create an additional folder here.
If the submission succeeds, job graph files will be cleaned up, while leaving this folder remained in the tmp dir.
…time for RestClusterClient
b7541ba
to
06a7afe
Compare
@@ -359,7 +333,8 @@ public CompletableFuture<JobID> submitJob(@Nonnull JobGraph jobGraph) { | |||
() -> { | |||
try { | |||
final java.nio.file.Path jobGraphFile = | |||
Files.createTempFile(tempDir, "flink-jobgraph", ".bin"); | |||
Files.createTempFile( | |||
"flink-jobgraph-" + jobGraph.getJobID(), ".bin"); |
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.
I have to add the jobid into the job graph file name, in order to check whether the job graph file has been deleted in testJobGraphFileCleanedUpOnJobSubmissionFailure
. cc @zhuzhurk
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.
LGTM.
…time for RestClusterClient This closes #23363
…time for RestClusterClient This closes #23363
…time for RestClusterClient This closes apache#23363
What is the purpose of the change
Fix FLINK-32974
After FLINK-32226, when creating a new RestClusterClient, a temporary directory (named
flink-rest-client-jobgraphsxxx
) is created, but the directory is never cleaned up, which may cause the inode to be used up.In this PR, we try to solve this problem by using fixed directory
flink-rest-client-jobgraphs
instead of creating a temporary directoryflink-rest-client-jobgraphsxxx
every timeVerifying this change
Add test
RestClusterClientTest#testTempDirCleanedUpOnClose
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation