Merge lp:~jamesodhunt/libnih/libnih-inotify-overflow-fix-for-777093 into lp:libnih
Status: | Needs review |
---|---|
Proposed branch: | lp:~jamesodhunt/libnih/libnih-inotify-overflow-fix-for-777093 |
Merge into: | lp:libnih |
Diff against target: |
158 lines (+94/-3) 4 files modified
ChangeLog (+14/-0) nih/tests/test_watch.c (+69/-0) nih/watch.c (+8/-0) po/libnih.pot (+3/-3) |
To merge this branch: | bzr merge lp:~jamesodhunt/libnih/libnih-inotify-overflow-fix-for-777093 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Scott James Remnant | Needs Fixing | ||
Review via email: mp+65372@code.launchpad.net |
Description of the change
Special case code to handle inotify event queue overflow (LP:#777093).
* nih/watch.c: nih_watch_reader(): Handle situation where kernel
is generating events faster than can be consumed by simply
ignoring them. Failure to do so results in an assertion failure in
nih_
contain an invalid watch descriptor (-1).
* nih/tests/
- Added PROC_MAX_INOTIFY define.
- test_reader(): Added test to check for inotify event queue overflow
handling.
Unmerged revisions
- 1050. By James Hunt
-
Special case code to handle inotify event queue overflow (LP:#777093).
* nih/watch.c: nih_watch_reader(): Handle situation where kernel
is generating events faster than can be consumed by simply
ignoring them. Failure to do so results in an assertion failure in
nih_watch_handle_ by_wd() since the inotify_event object will
contain an invalid watch descriptor (-1).
* nih/tests/test_watch. c:
- Added PROC_MAX_INOTIFY define.
- test_reader(): Added test to check for inotify event queue overflow
handling.
NAK.
This code is still not "handling" the problem, it's just ignoring it.
Take Upstart for example; it uses inotify to watch its configuration directory. A queue overflow could mean someone just untarred a giant /etc/init config set into the directory, ignoring overflow means that Upstart will miss some files.
Upstart will probably want to respond to queue overflow by walking the directory manually to see what it missed.