Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Fresh eyes - linux::Inotify2 event delays

by kikuchiyo (Hermit)
on Apr 06, 2022 at 17:09 UTC ( [id://11142742]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Fresh eyes - linux::Inotify2 event delays
in thread Fresh eyes - linux::Inotify2 event delays

Just to offer a negative data point: we're doing something similar to your use case at $work, that is, we rely on inotify to postprocess call recordings that were finished by Asterisk, monitoring IN_CLOSE_WRITE events, just like you, and to my knowledge we've never seen such random delays in receiving events during the 3+ years this system has been in production. However, in our case the user side inotify implementation is in Go.

What kernel version do you use? That may be relevant.

  • Comment on Re^3: Fresh eyes - linux::Inotify2 event delays

Replies are listed 'Best First'.
Re^4: Fresh eyes - linux::Inotify2 event delays
by ghenry (Vicar) on Apr 07, 2022 at 15:28 UTC

    Found it. Our retry is in blocking mode and the CDR it is trying to find does not ever exist (normally there is a delay to them showing up). Once the retry fully expires, ->poll() does the next read on the file descriptors and picks up all the queued events. There are not many events, so no overruns (missed events) and linux just leaves them there for collection when ready. It wasn't my code :-)

Re^4: Fresh eyes - linux::Inotify2 event delays
by ghenry (Vicar) on Apr 06, 2022 at 19:00 UTC

    This is on a CentOS 7 NAS. The files are getting written to it over an NFS share, but watching on the NAS file system side. Kernel 3.10.0-1160.59.1.el7.x86_64. The python inotify has no issues it seems. We might switch to inotifywait like @choroba says and like another dept at $work uses. Or switch to C or Go. Very strange. Again, we get all the events and it feels like they are flushed to us. I might ditch retry and go to ->read. We're playing with the python version to pop UUIDs into a Redis FIFO/queue and move find_call_details() and email_recording() into separate program to speak to Redis.

      NFS, ouch. In that case, all bets are off.

      I don't have direct experience with this combination (NFS+inotify), I just remember reading about it that may work, may not work, or anything in between.

        Ah, but we're watching on the file system not on an NFS mount. Like I sat, Python version not missing nor are we missing events. Very weird.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2025-11-12 11:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (68 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.