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
There is at least one race condition when creating a pygtail instance at the same time a logfile is rotated, which can lead to impossible offset files being created. A test-case for this can be found in this commit: 98d3d50
This is caused by __init__ determining the name of the logfile referenced by offset_file_inode, but the file only being opened once the first line is read. If the file was rotated in between, _filehandle will open the newer logfile, but try to seek to the old offset, which in most cases is after the end of the file, so the read will fail. However when writing the offset, tell() is used, which will return the offset that was seeked to, not the length of the new file -> We end up with the inode of the new file, but the old offset being written to the offset file.
The text was updated successfully, but these errors were encountered:
There is at least one race condition when creating a pygtail instance at the same time a logfile is rotated, which can lead to impossible offset files being created. A test-case for this can be found in this commit: 98d3d50
This is caused by
__init__
determining the name of the logfile referenced byoffset_file_inode
, but the file only being opened once the first line is read. If the file was rotated in between,_filehandle
will open the newer logfile, but try to seek to the old offset, which in most cases is after the end of the file, so the read will fail. However when writing the offset,tell()
is used, which will return theoffset
that was seeked to, not the length of the new file -> We end up with the inode of the new file, but the old offset being written to the offset file.The text was updated successfully, but these errors were encountered: