-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
in_tail: fix symlink log rotation for stat(2) backend on Linux (#2052)
When compiled with FLB_HAVE_INOTIFY=no for linux records were continuously resent if the files in PATH are symlinks. This patch ensures the fs_stat file monitoring correctly handles symlinks when checking for file rotations. The issue was found when running fluentbit as a daemonset in kubernetes where all files in /var/log/containers/* are symlinks. This patch was tested by forwarding 1M records of 1K size when compiled with both FLB_HAVE_INOTIFY=no/yes and verifying the output metrics reported exactly 1M records. The test was executed by running a container logging to stdout in a kubernetes cluster where symlinks are the target input. Further docker was configured to rotate logs at 10M to ensure multiple file rotations occurred. Signed-off-by: Zack Wine <[email protected]>
- Loading branch information
Showing
3 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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