Summary: | race condition in reloading config files | ||
---|---|---|---|
Product: | dbus | Reporter: | Colin Walters <walters> |
Component: | core | Assignee: | Havoc Pennington <hp> |
Status: | RESOLVED FIXED | QA Contact: | John (J5) Palmieri <johnp> |
Severity: | normal | ||
Priority: | medium | CC: | walters, zeuthen |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
a patch
updated patch updated patch |
Description
Colin Walters
2009-05-06 08:22:33 UTC
One solution that comes to mind is to only do the drop/readd if the set of monitored directories is different (and in reality, it basically never will be) Another thought - a "big crude hammer" fix might be to: while (config_changed) { if (parse_config() == SUCCESS) { config_changed = FALSE; break; } sleep(1); } Additional data here is a sample sequence of events for dpkg installing an updated config file: http://paste.ubuntu.com/165526/ Created attachment 32166 [details] [review] a patch Here is a patch that fixes this for the inotify implementation by replacing bus_watch_directory and bus_drop_all_directory_watches by bus_set_watched_dirs which takes care not to drop any directories that should remain watched. Created attachment 32881 [details] [review] updated patch In the big picture this patch really obsoletes the old monitoring API; the old functions were no longer called by the bus core. So I deleted them from dir-watch-inotify.c. I did some other small changes like documenting the API, fixing mismatch of strdup and dbus_free. Created attachment 32882 [details] [review] updated patch Register a shutdown func to clean up the dbus_strdup memory, otherwise test suite hates us. Pushed to dbus-1.2 as 8a9880ffd2 |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.