- Notifications
You must be signed in to change notification settings - Fork 25.5k
FileWatchingService should not throw for missing file #126264
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
FileWatchingService should not throw for missing file #126264
Conversation
Missing file is a valid state for FileWatchingService so that the exception should be suppressed.
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @ywangd, I've created a changelog YAML for you. |
try { | ||
attr = filesReadAttributes(path, BasicFileAttributes.class); | ||
BasicFileAttributes attr = filesReadAttributes(path, BasicFileAttributes.class); | ||
return new FileUpdateState(attr.lastModifiedTime().toMillis(), path.toRealPath().toString(), attr.fileKey()); |
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.
path.toRealPath()
can also throw NoSuchFileException
and lead to failure like this one. So moving it inside the try-catch.
I agree with this change but looks like there are some unanswered questions:
|
Err I just realised that I linked the wrong build scan. The correct one is this (also fixed in the above comment). This failure technically has nothing to do with MP. It failed on MP test because it happens to be the test that modify
So the file watching service threw |
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.
Thanks for clarifying! Yes, we should handle that case. LGTM!
@elasticmachine update branch |
@elasticmachine update branch |
@elasticmachine update branch |
Missing file is a valid state for FileWatchingService so that the exception should be suppressed.