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
I am tailing a file that at some point (while tailing) gets deleted. I don't use reopen option, when the file is deleted I expect the tail to stop. The tail really stops, but I can see the file descriptor is not.
when running lsof I can see all files tailed with a "(deleted)" string at the end.
Seems weird as tailFileSync starts with defer tail.close() and when the file gets deleted an ErrStop is raised and should just cause a return (triggering the defer).
What am I missing?
The text was updated successfully, but these errors were encountered:
The tail only detect changes after reaching to the EOF. If you do not consume the tail.Lines chan, the sendLine func will be blocked. The tail may not be able to reach to the EOF, thus cannot detect the file deletion change.
I can see that sendLine is blocking with the chan, but assuming I will eventually process all chan lines (and I do), the tail loop will try to read the next line and will fail, causing the loop to end with tail.Killf(). This should close the file descriptor/reader, isn't it?
I am tailing a file that at some point (while tailing) gets deleted. I don't use reopen option, when the file is deleted I expect the tail to stop. The tail really stops, but I can see the file descriptor is not.
when running
lsof
I can see all files tailed with a "(deleted)" string at the end.Seems weird as
tailFileSync
starts withdefer tail.close()
and when the file gets deleted anErrStop
is raised and should just cause a return (triggering the defer).What am I missing?
The text was updated successfully, but these errors were encountered: