diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-25 14:51:43 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-26 09:26:11 +0000 |
commit | 2c414f659d793d732041614caedd773959eb4f27 (patch) | |
tree | c52c8c4ccd4fdd4b7f8bcf69999fe61133276693 | |
parent | 1463fc0448d1a6a7265806a4a8b165b610dfb43f (diff) | |
download | bitbake-2c414f659d793d732041614caedd773959eb4f27.tar.gz |
cooker: Fix inotify watches causing memory resident bitbake corruption
Thanks to great debugging from pavel@zhukoff.net we had a simpler reproducer
for the corruption see in oe-selftest when using BB_SERVER_TIMEOUT=60, i.e.
with bitbake in memory resident mode. This was effectively:
oe-selftest -r devtool.DevtoolUpgradeTests.test_devtool_upgrade devtool.DevtoolUpgradeTests.test_devtool_upgrade_git -j 1 -K
The issue is that if directories are removed (such as workspace), if
they are added again, we don't have the watches in place any more. This
patch adds some slightly paranoid checks to ensure we do the correct things
for directory additions and removals (we track directories, not files
specifically to avoid running out of watches).
[YOCTO #14023]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/cooker.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index c0a7a2fd7..eac956aa9 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -253,6 +253,11 @@ class BBCooker: return if not event.pathname in self.configwatcher.bbwatchedfiles: return + if "IN_ISDIR" in event.maskname: + if "IN_CREATE" in event.maskname: + self.add_filewatch([[event.pathname]], watcher=self.configwatcher, dirs=True) + elif "IN_DELETE" in event.maskname and event.pathname in self.watcher.bbseen: + self.configwatcher.bbseen.remove(event.pathname) if not event.pathname in self.inotify_modified_files: self.inotify_modified_files.append(event.pathname) self.baseconfig_valid = False @@ -266,6 +271,11 @@ class BBCooker: if event.pathname.endswith("bitbake-cookerdaemon.log") \ or event.pathname.endswith("bitbake.lock"): return + if "IN_ISDIR" in event.maskname: + if "IN_CREATE" in event.maskname: + self.add_filewatch([[event.pathname]], dirs=True) + elif "IN_DELETE" in event.maskname and event.pathname in self.watcher.bbseen: + self.watcher.bbseen.remove(event.pathname) if not event.pathname in self.inotify_modified_files: self.inotify_modified_files.append(event.pathname) self.parsecache_valid = False |