summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2013-11-11 16:14:17 +0100
committerTomas Bzatek <tbzatek@redhat.com>2013-11-11 16:14:17 +0100
commit2d81fdc4583e4b4c6d7a0c220ff14ad1b0defc34 (patch)
tree631fad6b14975cfdbbd4367a40071e647f285ea7 /tools
parenta1720b88b0047dbdfaff33c485dc88379b2ee67e (diff)
downloadopenlmi-providers-2d81fdc4583e4b4c6d7a0c220ff14ad1b0defc34.tar.gz
openlmi-providers-2d81fdc4583e4b4c6d7a0c220ff14ad1b0defc34.tar.xz
openlmi-providers-2d81fdc4583e4b4c6d7a0c220ff14ad1b0defc34.zip
account: Watch parent directory instead of files directly
This commit changes the way the inotify watching is done. Instead of watching files directly, we watch the directory they reside in and just filter out changes in files we don't want to watch. This brings a benefit of reliable notification through file deletions and other inode number changing changes. It's also less racy as we had to recreate watches on IN_IGNORED events with possibility of missing some events. File deletions or atomic replaces were always problematic. There are some lingering issues however. The most severe is a problem of shadow files and libuser calls. At the time the event is processed further in the gather() method, shadow files may not been updated yet. This causes libuser to miss some information required for proper CIM object instance construction, potentially propagating half-baked data to the user. This could be solved by implementing a settle timeout, possibly compressing more fast-coming events into one. For the moment a simple artificial sleep has been put before returning from the watcher in good hope shadow files are updated properly. Then there's a current problem of throwing out the rest of the read buffer, losing notifications of other files if watched. This is by current design of the watcher callback and could be fixed by implementing proper event queue.
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions