Skip to content

Periodically check inode numbers#2

Merged
markdascher merged 5 commits intomasterfrom
compare-inodes
Feb 10, 2017
Merged

Periodically check inode numbers#2
markdascher merged 5 commits intomasterfrom
compare-inodes

Conversation

@markdascher
Copy link
Contributor

Use File.Stat(), os.Stat(name), and os.SameFile to periodically compare an idle file's inode number with whatever is currently assigned that filename.

This fixes two bugs related to log file rotation:

  • Symbolic links. If a Follower is watching something via a symbolic link, and the link is modified to point to a new file, there's no indication from inotify.
  • Potential race condition if a file is moved/renamed before inotify is ready.

Added a test to confirm that symbolic links are now handled properly.

Copy link
Contributor

@snorecone snorecone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wonderful, and I appreciate the Coleridge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants