Repository navigation
[ISSUE #11608] fix(srvutil): watch configured files that are created after startup - #11609
Merged
ShannonDing merged 2 commits intoNov 26, 2026
Merged
Conversation
…eated after startup
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #11609 +/- ##
=============================================
+ Coverage 50.47% 50.69% +0.22%
- Complexity 14711 14784 +73
=============================================
Files 1391 1391
Lines 103541 103571 +30
Branches 13575 13575
=============================================
+ Hits 52261 52509 +248
+ Misses 45042 44807 -235
- Partials 6238 6255 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ShannonDing
approved these changes
Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Issue(s) This PR Fixes
Fixes #11608
Brief Description
FileWatchServiceonly registered watch targets that already existed when the service was constructed.run0()re-hashes only the paths stored incurrentHash, so a configured file that did not exist at startup was never watched: when it was created later (for example a TLS certificate provisioned or mounted after the process started),Listener.onChangedwas never invoked and the dynamic TLS certificate reload never happened.md5Digest()already returns an empty hash for a missing file and reuses the previous hash for a deleted file, so theexists()check in the constructor is not required. All non-empty configured paths are now registered, and a later-created file is detected on the next watch round. Behaviour for deleted files is unchanged: the deletion itself does not produce an event, and a subsequent re-creation with different content does.How Did You Test This Change?
Added
FileWatchServiceTest#watchSingleFile_CreatedAfterStart, which constructs the service with a non-existent path, creates the file after the service starts and asserts that the listener is called.mvn -pl srvutil -am "-Dtest=FileWatchServiceTest" test- passed (Tests run: 6, Failures: 0, Errors: 0)mvn -pl srvutil validate(project checkstyle) - 0 violations