FileWatchingService should not throw for missing file#126264
FileWatchingService should not throw for missing file#126264elasticsearchmachine merged 5 commits intoelastic:mainfrom
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.
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 |
jfreden
left a comment
There was a problem hiding this comment.
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.