-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
stop monitoring excluded paths #21282
Conversation
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
1 similar comment
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
Pinging @elastic/siem (Team:SIEM) |
Hi, Could someone please have a look at this PR? Feel free to let me know your thought on this. Thanks in advance. |
jenkins run tests |
Hi, the test is completed. is there any concern regarding this PR? Please let me know. |
@@ -154,7 +161,7 @@ func (watcher *recursiveWatcher) forwardEvents() error { | |||
switch event.Op { | |||
case fsnotify.Create: | |||
err := watcher.addRecursive(event.Name) | |||
if err != nil { | |||
if err != nil && !watcher.isExcludedPath(event.Name) { |
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.
So the changes to this function are ignoring errors related to ignored paths. Does it still make sense to act on events for ignored paths?
For example, adding a recursive watch on an ignored directory. I wonder if it will make more sense to just skip those events.
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.
@adriansr Thanks for the review, it makes more sense to stop watching them. I've updated this PR regarding your suggestion, please have a look.
3e68cf9
to
05ac7c6
Compare
jenkins, test this |
jenkins, test this please |
@adriansr do we have anything left to address as part of this PR? would love to get this in so that we can reenable log shipping on our end. |
Jenkins run tests |
💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
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.
@newly12, all is looking good. Only needs a changelog entry in CHANGELOG.next.asciidoc.
05ac7c6
to
e0f4aa8
Compare
Thanks @adriansr ! I've |
jenkins run tests |
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
If the files match the excluded pattern, recursiveWatcher does not emit events for them, as well as errors if any. (cherry picked from commit af8eedd)
If the files match the excluded pattern, recursiveWatcher does not emit events for them, as well as errors if any. (cherry picked from commit af8eedd) Co-authored-by: Peter Deng <[email protected]>
What does this PR do?
If the files match the excluded pattern,
recursiveWatcher
does not emit events for them, as well as errors if any.Why is it important?
This eliminates unnecessary warning logs for file paths that user intends to exclude.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
run test case
TestRecursiveExcludedPaths
Related issues