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

Add error handle code for stale file handler when cl upload #4304

Merged
merged 9 commits into from
Nov 8, 2022

Conversation

wwwjn
Copy link
Contributor

@wwwjn wwwjn commented Nov 6, 2022

Reasons for making this change

When uploading from nlp machine, we might meet stale file handler(https://www.baeldung.com/linux/stale-file-handles) generated by other process. Add some code to just ignore those stale file handlers.

For stale file handlers, we can not even ls them.
image

Related issues

Screenshots

Checklist

  • I've added a screenshot of the changes, if this is a frontend change
  • I've added and/or updated tests, if this is a backend change
  • I've run the pre-commit.sh script
  • I've updated docs, if needed

@wwwjn wwwjn changed the title add error handle for stale file handler Add error handle code for stale file handler when cl upload Nov 6, 2022
@wwwjn
Copy link
Contributor Author

wwwjn commented Nov 6, 2022

Since this part of code is running by local CLI, and I can not create a stale file handler using local PC. Will keep an eye on this and test it out when CL version is updated.

if ignore_nonexistent_path:
# If we have trouble list the dir, return the size of this path as 0
# Do not raise error and just ignore the stale file handler/
return 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this potentially suppress other errors? Maybe worth printing out a warning at least (assuming it doesn't result in too much output)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! I will add a Warning print with the path, and test it out using the dev environment before getting it merged.

@wwwjn wwwjn merged commit ef28c9e into master Nov 8, 2022
@wwwjn wwwjn deleted the fix-stale-file-handler branch November 8, 2022 18:42
@leilenah leilenah mentioned this pull request Nov 16, 2022
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.

None yet

2 participants