Bug 2407742 - perl-File-Tail rereads entire file even if file has not been rotated
Summary: perl-File-Tail rereads entire file even if file has not been rotated
Keywords:
Status: NEW
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: perl-File-Tail
Version: epel9
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Tom "spot" Callaway
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-10-30 19:13 UTC by Mark Tinberg
Modified: 2025-10-30 19:13 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch for RPM spec, apply first because init-objects patch changes line numbers (1.04 KB, patch)
2025-10-30 19:13 UTC, Mark Tinberg
no flags Details | Diff

Description Mark Tinberg 2025-10-30 19:13:18 UTC
Created attachment 2111494 [details]
Patch for RPM spec, apply first because init-objects patch changes line numbers

Description of problem:

A file being tailed which is idle for too long will get re-opened and re-read from the beginning, even if the file has _not_ rotated and the new file handle is the same file as the old one, the reset_tail logic kicks in even though the file hasn't been reset.  The expected behavior is that if we reopen the same file to reset our start position for reading at the same place we left off. I think the bug is in the check for the inode cached in the object against the new file handle when we re-open, this doesn't work as expected because the initial file open doesn't cache the inode in the object, only after one rotation does the inode get added.  If you don't re-open a file because it has activity (resetafter == 100s = interval 10s * adjustafter 10s) at least every 100s then this issue can go unnoticed.

https://stackoverflow.com/questions/78312852/getting-perl-filetail-to-begin-streaming-a-file-towards-the-end

Version-Release number of selected component (if applicable): perl-File-Tail-1.3-24.el9

Additional info:

attached is a patch for the RPM, I needed to re-order with the init-objects patch because that adds lines in Tail.pm file which breaks patch/diff without changing the %_default_patch_fuzz value.

I would have also added this to a fork in src.fedoraproject.org but I haven't used Pagure before and couldn't figure out how to make my fork writable by me.  I have this same patch added to a local fork of this package in our internal Gitlab with Epoch: 1 so as to not conflict with EPEL.


Note You need to log in before you can comment on or make changes to this bug.