Skip to content

Commit

Permalink
Update tail to use polling instead of fsnotify
Browse files Browse the repository at this point in the history
fsnotify is difficult to use correctly, especially in the face of usage
of symlinks like we often see in kube. The stat() calls will only happen
while waiting for additional data and not on a continual basis.
  • Loading branch information
Mike Keesey authored and mkeesey committed Sep 18, 2024
1 parent 8b290db commit 78daae6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion collector/logs/sources/tail/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (s *TailSource) AddTarget(target FileTailTarget, updateChan <-chan FileTail
tailerCtx, shutdown := context.WithCancel(s.groupCtx)
batchQueue := make(chan *types.Log, 512)
outputQueue := make(chan *types.LogBatch, 1)
tailConfig := tail.Config{Follow: true, ReOpen: true}
tailConfig := tail.Config{Follow: true, ReOpen: true, Poll: true}
existingCursorPath := cursorPath(s.cursorDirectory, target.FilePath)
fileId, position, err := readCursor(existingCursorPath)
if err == nil {
Expand Down

0 comments on commit 78daae6

Please sign in to comment.