Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Man, File::Tail is just beating me down!

by matija (Priest)
on Jan 20, 2008 at 14:03 UTC ( #663274=note: print w/ replies, xml ) Need Help??


in reply to Man, File::Tail is just beating me down!

First of all, File::Tail is on CPAN - there is no need to post it all here.

Having said that, I think you are running into some kind of a timing problem. File::Tail tries to be clever about detecting when a file has been rotated, and it seems that, under very heavy loads, it sometimes gets a false positive (it thinks that the file has been rotated when it really has not).

I've never been able to generate a reliable test case that would trigger that bug so I could debug it.

My advice is:

  • See if bumping maxinterval to a higher value helps
  • See if bumping adjustfter to a higher value helps
  • (may not be feasible for your application) put 0 or a small positive value into reset_tail - that will make it restart from the end of the file, or n lines from the end of the file - which might be better for your application that starting from the very beginning.

Hope this helps


Comment on Re: Man, File::Tail is just beating me down!
Re^2: Man, File::Tail is just beating me down!
by hallikpapa (Scribe) on Jan 21, 2008 at 04:32 UTC
    Excellent suggestions. If I use the reset_tail function and I am keeping track of the line number(s) that are being read, is there a way I can make it jump straight to a specific line in case of a restart?
      Not currently, no.
        As a follow up, since I made adjustments and increased those two values (30,60) the restarts have stopped to once a day. Oddly enough, they always happen at the 3rd minute. When I say that, it's 12:03, 09:33, 15:23, etc..Probably just a coincidence, there is no cron job, or anything like that. But I will continue to monitor.
Re^2: Man, File::Tail is just beating me down!
by Anonymous Monk on Jul 19, 2010 at 19:15 UTC
    I'm running into the same issue, something causing resets. I have set reset_tail to 0, but the file pointer is still reset to the beginning of the file, which has very bad effects in my application. I'll try setting maxinterval and adjustafter to see if it helps. I'd be happy to help debug this. I think I can reproduce the bug about once/day.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://663274]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2014-07-30 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (234 votes), past polls