You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We have a file that we're tailing where we're also interested in the file offset location. However, when we do t.Tell(), we sometimes run into the exception "err":"seek <filename>: file already closed"
Code:
t, err := tail.TailFile(
path,
tail.Config{
Follow: true,
ReOpen: true,
})
for line := range t.Lines {
// Fetch the current offset in the tailed file
offset, err := t.Tell()
// consume data
}
Has anyone else seen a similar issue with the file being closed? We've kind of solved this by adding a small wait and a retry in the t.Tell() function call, and that's resolved the issue, but we'd like to understand if this is a bug in the underlying tailing code where it's prematurely closing files.
System information
tail version: v1.4.8
OS: Ubuntu: 18.04
The text was updated successfully, but these errors were encountered:
Describe the bug
We have a file that we're tailing where we're also interested in the file offset location. However, when we do
t.Tell()
, we sometimes run into the exception"err":"seek <filename>: file already closed"
Code:
Has anyone else seen a similar issue with the file being closed? We've kind of solved this by adding a small wait and a retry in the
t.Tell()
function call, and that's resolved the issue, but we'd like to understand if this is a bug in the underlying tailing code where it's prematurely closing files.System information
The text was updated successfully, but these errors were encountered: