diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-09 12:57:57 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-13 09:28:14 +0100 |
commit | a0f729d31d15d8314016d0e19e5e115b5761d535 (patch) | |
tree | af4d72d4546519ccca0087e9d8bd1329bc1e6dbe /bitbake/lib | |
parent | 019f518287bb00f7e7121289b4859661af201d89 (diff) | |
download | poky-a0f729d31d15d8314016d0e19e5e115b5761d535.tar.gz |
bitbake: cooker: Improve inotify overflow handling
Add a proper function for clearing the mtime cache. Clean up the inotify
event overflow case to err on the side of caution and clear any potentially
now out of sync caches.
(Bitbake rev: ec60459fe2ba16966544eebff43b061abb7ed3ba)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 5 | ||||
-rw-r--r-- | bitbake/lib/bb/parse/__init__.py | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 77b7f3dde1..b3d6cd9e34 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -189,7 +189,7 @@ class BBCooker: | |||
189 | 189 | ||
190 | # If being called by something like tinfoil, we need to clean cached data | 190 | # If being called by something like tinfoil, we need to clean cached data |
191 | # which may now be invalid | 191 | # which may now be invalid |
192 | bb.parse.__mtime_cache = {} | 192 | bb.parse.clear_cache() |
193 | bb.parse.BBHandler.cached_statements = {} | 193 | bb.parse.BBHandler.cached_statements = {} |
194 | 194 | ||
195 | self.ui_cmdline = None | 195 | self.ui_cmdline = None |
@@ -247,7 +247,9 @@ class BBCooker: | |||
247 | def config_notifications(self, event): | 247 | def config_notifications(self, event): |
248 | if event.maskname == "IN_Q_OVERFLOW": | 248 | if event.maskname == "IN_Q_OVERFLOW": |
249 | bb.warn("inotify event queue overflowed, invalidating caches.") | 249 | bb.warn("inotify event queue overflowed, invalidating caches.") |
250 | self.parsecache_valid = False | ||
250 | self.baseconfig_valid = False | 251 | self.baseconfig_valid = False |
252 | bb.parse.clear_cache() | ||
251 | return | 253 | return |
252 | if not event.pathname in self.configwatcher.bbwatchedfiles: | 254 | if not event.pathname in self.configwatcher.bbwatchedfiles: |
253 | return | 255 | return |
@@ -259,6 +261,7 @@ class BBCooker: | |||
259 | if event.maskname == "IN_Q_OVERFLOW": | 261 | if event.maskname == "IN_Q_OVERFLOW": |
260 | bb.warn("inotify event queue overflowed, invalidating caches.") | 262 | bb.warn("inotify event queue overflowed, invalidating caches.") |
261 | self.parsecache_valid = False | 263 | self.parsecache_valid = False |
264 | bb.parse.clear_cache() | ||
262 | return | 265 | return |
263 | if not event.pathname in self.inotify_modified_files: | 266 | if not event.pathname in self.inotify_modified_files: |
264 | self.inotify_modified_files.append(event.pathname) | 267 | self.inotify_modified_files.append(event.pathname) |
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index a2952ecc0f..2fc4002db5 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py | |||
@@ -84,6 +84,10 @@ def update_cache(f): | |||
84 | logger.debug(1, "Updating mtime cache for %s" % f) | 84 | logger.debug(1, "Updating mtime cache for %s" % f) |
85 | update_mtime(f) | 85 | update_mtime(f) |
86 | 86 | ||
87 | def clear_cache(): | ||
88 | global __mtime_cache | ||
89 | __mtime_cache = {} | ||
90 | |||
87 | def mark_dependency(d, f): | 91 | def mark_dependency(d, f): |
88 | if f.startswith('./'): | 92 | if f.startswith('./'): |
89 | f = "%s/%s" % (os.getcwd(), f[2:]) | 93 | f = "%s/%s" % (os.getcwd(), f[2:]) |