Skip to content

Commit 4011dad

Browse files
committed
Update comment
1 parent dea2bfe commit 4011dad

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

internal/component/loki/source/file/internal/tail/file.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ func (f *File) reopen(truncated bool) error {
214214
if err := blockUntilExists(f.ctx, f.cfg); err != nil {
215215
return fmt.Errorf("failed to detect creation of %s: %w", f.cfg.Filename, err)
216216
}
217-
backoff.Wait()
218217
continue
219218
}
220219
return fmt.Errorf("Unable to open file %s: %s", f.cfg.Filename, err)

internal/component/loki/source/file/tailer.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,10 @@ func getDecoder(encoding string) (*encoding.Decoder, error) {
266266
return encoder.NewDecoder(), nil
267267
}
268268

269-
// readLines consumes the t.tail.Lines channel from the
270-
// underlying tailer. It will only exit when that channel is closed. This is
271-
// important to avoid a deadlock in the underlying tailer which can happen if
272-
// there are unread lines in this channel and the Stop method on the tailer is
273-
// called, the underlying tailer will never exit if there are unread lines in
274-
// the t.tail.Lines channel
269+
// readLines reads lines from the tailed file by calling Next() in a loop.
270+
// It processes each line by sending it to the receiver's channel and updates
271+
// position tracking periodically. It exits when Next() returns an error,
272+
// this happens when the tail.File is stopped or or we have a unrecoverable error.
275273
func (t *tailer) readLines(done chan struct{}) {
276274
level.Info(t.logger).Log("msg", "tail routine: started", "path", t.key.Path)
277275
var (

0 commit comments

Comments
 (0)