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

[HotFix] Fix createTaskInstanceWorkingDirectory failed if the old path exist #15377

Merged

Conversation

ruanwenjun
Copy link
Member

Purpose of the pull request

Fix Files.deleteIfExists cannot delete when the directory is not empty

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

If your pull request contain incompatible change, you should also add it to docs/docs/en/guide/upgrede/incompatible.md

@ruanwenjun ruanwenjun added the bug Something isn't working label Dec 28, 2023
@ruanwenjun ruanwenjun force-pushed the dev_wenjun_fixDeleteWorkingDirectoryDev branch from 0f6c407 to 5747436 Compare December 28, 2023 09:34
Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

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

LGTM.

SbloodyS
SbloodyS previously approved these changes Jan 3, 2024
Copy link
Member

@fuchanghai fuchanghai left a comment

Choose a reason for hiding this comment

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

+1

try {
// Test if the working directory is exist
// will delete it and recreate
Files.createDirectory(Paths.get(taskWorkingDirectory));
Copy link
Member

@fuchanghai fuchanghai Jan 3, 2024

Choose a reason for hiding this comment

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

hi @ruanwenjun plz use Files.createDirectories to ensure that cascade creation does not report errors

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, thx.

@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (cb5317f) 38.03% compared to head (6bc6988) 38.04%.

❗ Current head 6bc6988 differs from pull request most recent head 7c3ba47. Consider uploading reports for the commit 7c3ba47 to get more accurate results

Files Patch % Lines
...e/dolphinscheduler/service/utils/ProcessUtils.java 0.00% 1 Missing ⚠️
...server/worker/utils/TaskExecutionContextUtils.java 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##                dev   #15377   +/-   ##
=========================================
  Coverage     38.03%   38.04%           
+ Complexity     4691     4688    -3     
=========================================
  Files          1304     1304           
  Lines         44771    44770    -1     
  Branches       4799     4799           
=========================================
+ Hits          17027    17031    +4     
+ Misses        25893    25888    -5     
  Partials       1851     1851           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ruanwenjun ruanwenjun force-pushed the dev_wenjun_fixDeleteWorkingDirectoryDev branch from 519177b to 7c3ba47 Compare January 15, 2024 02:03
Copy link

sonarcloud bot commented Jan 15, 2024

Copy link
Member

@fuchanghai fuchanghai left a comment

Choose a reason for hiding this comment

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

LGTM

@fuchanghai fuchanghai merged commit 0b873e6 into apache:dev Jan 15, 2024
56 checks passed
@fuchanghai fuchanghai added this to the 3.2.1 milestone Jan 15, 2024
@ruanwenjun ruanwenjun deleted the dev_wenjun_fixDeleteWorkingDirectoryDev branch January 15, 2024 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants