After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 476938 - gamin polls frequently when trying to watch non-existant directory
gamin polls frequently when trying to watch non-existant directory
Status: RESOLVED FIXED
Product: gamin
Classification: Other
Component: general
unspecified
Other Windows
: Normal normal
: ---
Assigned To: Gamin Maintainer(s)
Gamin Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2007-09-14 15:16 UTC by Ray Strode [halfline]
Modified: 2008-04-06 18:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
watch directory parent to get notified that directory becomes available (6.73 KB, patch)
2007-09-14 15:18 UTC, Ray Strode [halfline]
committed Details | Review

Description Ray Strode [halfline] 2007-09-14 15:16:04 UTC
(from https://bugzilla.redhat.com/show_bug.cgi?id=240385)

strace -p `pidof gam_server`
shows that gnome is looking for a bunch of directories in /etc/xdg and in ~, for
menus. These aren't there by dfault, so gamin has to poll to see if they get
created....
Comment 1 Ray Strode [halfline] 2007-09-14 15:18:14 UTC
Created attachment 95596 [details] [review]
watch directory parent to get notified that directory becomes available

The problem seems to be that gamin calls inotify_add_watch ("/some/dir/here") in a loop and each time gets back ENOENT.  The above patch makes it watch "/some/dir" to find out when "here" shows up, or watch "/some" to find out when "/some/dir" shows up.
Comment 2 Daniel Veillard 2007-10-11 15:14:34 UTC
Yes, that's a long standing limitation in that code and I think 
your patch fixes it in a nice way, feel free to patch in SVN,

  thanks a lot !

Daniel
Comment 3 Ray Strode [halfline] 2008-04-06 18:10:12 UTC
sorry for the long delay on this one.

commited to trunk:

2008-04-04  Ray Strode  <rstrode@redhat.com>

        * server/inotify-path.c
        (ip_watch_parent), (ip_start_watching), (ip_event_dispatch),
        (ip_event_callback): If a file being watched doesn't exist
        yet, then watch its parent to find out when it shows up
        instead of polling (bug 476938).