Handle both of stat and timer watchers are enabled and steady growing file case#3364
Conversation
files case In this case, timer watcher tells file contents every 1 seconds and file contents changes is also notified from stats watcher. In such circumstances, if some tailing files are steadily growing, previous implementation does not prevent log ingestion for written contents which is notified by stat watcher. This commit also prevents log ingestion in such cases. Signed-off-by: Hiroshi Hatake <hatake@calyptia.com>
3dc9367 to
27bb805
Compare
Signed-off-by: Hiroshi Hatake <hatake@calyptia.com>
Signed-off-by: Takuro Ashie <ashie@clear-code.com>
An idea is that adding a hook to touch the test log file to Please see the following example: |
Signed-off-by: Hiroshi Hatake <hatake@calyptia.com>
Signed-off-by: Hiroshi Hatake <hatake@calyptia.com>
1757297 to
bee9125
Compare
I'd considered this and I decided to add two testing scenarios. Both scenarios return same number of events per emits. |
|
I'm checking the tests, I feel some curious points. |
I've added a commit but probably it will fail on mac & windows. |
* Check elapsed time * Check exact number of emitted events * Check inotify is surely emitted * Remove a needless test. Signed-off-by: Takuro Ashie <ashie@clear-code.com>
Because they doesn't support inotify. Signed-off-by: Takuro Ashie <ashie@clear-code.com>
81162e9 to
d4d0118
Compare
|
Thanks! |
Signed-off-by: Hiroshi Hatake hatake@calyptia.com
Which issue(s) this PR fixes:
Follows up #3185
What this PR does / why we need it:
In this case, timer watcher tells file contents every 1 seconds and file
contents changes is also notified from stats watcher.
In such circumstances, if some tailing files are steadily growing,
previous implementation does not prevent log ingestion for written
contents which is notified by stat watcher.
This commit also prevents log ingestion in such cases.
Docs Changes:
No needed.
Release Note:
Same as title.
Additional context
I can implement this edge case patch, but how can we write down into test cases...?