summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-16 18:20:03 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-18 11:35:05 +0100
commit37c31a5adc26fc947a447ca9eae0983a654d1a33 (patch)
tree4d40adb741fd25fb0f60993e303ad5e9e7d5fa1a /bitbake/lib/bb/server
parentd1f84db670bd130353ebc5fb8077cf9657fb4e44 (diff)
downloadpoky-37c31a5adc26fc947a447ca9eae0983a654d1a33.tar.gz
bitbake: lib: Drop inotify support and replace with mtime checks
With the flush in serverlog() removed and a memory resident bitbake with a 60s timeout, the following could fail in strange ways: rm bitbake-cookerdaemon.log bitbake-layers add-layer ../meta-virtualization/ bitbake-layers add-layer ../meta-openembedded/meta-oe/ bitbake -m specifically that it might error adding meta-oe with an error related to meta-virt. This clearly shows that whilst bblayers.conf was modified, bitbake was not recognising that. This would fit with the random autobuilder issues seen when the serverlog flush() call was removed. The issue appears to be that you have no way to "sync()" the inotify events with the command stream coming over the socket. There is no way to know if there are changes in the IO queue which bitbake needs to wait for before proceeding with the next command. I did experiment with os.sync() and fsync on the inotify fd, however nothing addressed the issue. Since it is extremely important we have accurate cache data, the only realistic thing to do is to switch to stat() calls and check mtime. For bitbake commands, this is straightforward since we can revalidate the cache upon new connections/commands. For tinfoil this is problematic and we need to introduce and explict command "revalidateCaches" that the code can use to force bitbake to re-check it's cache validity. I've exposed this through tinfoil with a new "modified_files" function. So, this patch: a) drops inotify support within bitbake's cooker/server and switch to using mtime b) requires a new function call in tinfoil when metadata has been modified (Bitbake rev: da3ec3801bdb80180b3f1ac24edb27a698415ff7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/server')
-rw-r--r--bitbake/lib/bb/server/process.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index 40cb99bc97..993ae66279 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -410,12 +410,6 @@ class ProcessServer():
410 nextsleep = 0.1 410 nextsleep = 0.1
411 fds = [] 411 fds = []
412 412
413 try:
414 self.cooker.process_inotify_updates()
415 except Exception as exc:
416 serverlog("Exception %s in inofify updates broke the idle_thread, exiting" % traceback.format_exc())
417 self.quit = True
418
419 with bb.utils.lock_timeout(self._idlefuncsLock): 413 with bb.utils.lock_timeout(self._idlefuncsLock):
420 items = list(self._idlefuns.items()) 414 items = list(self._idlefuns.items())
421 415