File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
internal/component/loki/source/file Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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.
275273func (t * tailer ) readLines (done chan struct {}) {
276274 level .Info (t .logger ).Log ("msg" , "tail routine: started" , "path" , t .key .Path )
277275 var (
You can’t perform that action at this time.
0 commit comments