Commit 3b06524
in_tail: fix ignore_active_older_files to re-check mtime on aged-out files
When a file's mtime exceeded ignore_older while being actively monitored,
its inode was registered as aged-out and the file was removed from
monitoring. If new content was later appended (updating mtime), the scan
still excluded the file because the inode comparison matched without
re-checking the mtime.
Re-evaluate mtime in the aged-out inode branch; only skip if the file is
still too old, otherwise unregister the aged-out entry and allow re-pickup.
Applied to both tail_scan_glob.c (Linux/macOS) and tail_scan_win32.c (Windows).
Also preserve file->offset in ignored_file_sizes when aging out a file, so
that on re-pickup the scan resumes from the last-read position rather than
re-reading from the beginning or silently skipping new content by seeking
to EOF.
Signed-off-by: zshuang0316 <zshuang0316@163.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 909efc4 commit 3b06524
3 files changed
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2438 | 2438 | | |
2439 | 2439 | | |
2440 | 2440 | | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
2441 | 2446 | | |
2442 | 2447 | | |
2443 | 2448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
257 | 260 | | |
258 | 261 | | |
259 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
114 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
| |||
0 commit comments