Skip to contentSkip to conversation

cooker: Handle inofity queue overflows more gracefully

PATCH New Richard Purdie 1 participant 1 message Dec 7, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cooker: Handle inofity queue overflows more gracefully

If many files change and the inotify queue overflows, rather than print a traceback, invalidate the caches and warn the user.

[YOCTO #10676]

---
 bitbake/lib/bb/cooker.py | 8 ++++++++
 1 file changed, 8 insertions(+)
bitbake/lib/bb/cooker.py +8 -0
index 1fe693c..9999e58 100644
@@ -252,6 +252,10 @@ class BBCooker:
         signal.signal(signal.SIGHUP, self.sigterm_exception)
 
     def config_notifications(self, event):
+        if event.maskname == "IN_Q_OVERFLOW":
+            bb.warn("inotify event queue overflowed, invalidating caches.")
+            self.baseconfig_valid = False
+            return
         if not event.pathname in self.configwatcher.bbwatchedfiles:
             return
         if not event.pathname in self.inotify_modified_files:
@@ -259,6 +263,10 @@ class BBCooker:
         self.baseconfig_valid = False
 
     def notifications(self, event):
+        if event.maskname == "IN_Q_OVERFLOW":
+            bb.warn("inotify event queue overflowed, invalidating caches.")
+            self.parsecache_valid = False
+            return
         if not event.pathname in self.inotify_modified_files:
             self.inotify_modified_files.append(event.pathname)
         self.parsecache_valid = False
Signature · 1 line
2.7.4