Skip to contentSkip to conversation

[2.8][PATCH 0/1] Patch review

bitbake Yoann Congal 1 participant 2 messages Oct 15

lore
Share & tools
lore
#0 lore raw

Please review this set of changes for scarthgap and have comments back by end of day Friday, October 16.

Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/valkyrie/?#/builders/29/builds/4934
* reproducible failed with #15898 – New sstate.yp.org CDN revealed partial sstate reproducibility tests false-positive error But the test warns about a missing sstate object from the reproducibleB
build that is supposed to rebuild everything anyway, then, rebuilds the
recipe. So, there is no issue with the series.

The following changes since commit d3b32587c2314febf96897f97e0172790b4fc1cf:

toastergui/views: Replace os.system call with improved parameter handling (2026-09-28 22:25:53 +0100)

are available in the Git repository at:

https://git.openembedded.org/bitbake-contrib stable/2.8-review
https://git.openembedded.org/bitbake-contrib/log/?h=stable/2.8-review

for you to fetch changes up to 6b443060ee96a62efb94723c97f22b51c9b20507:

prserv: commit new revisions when a request succeeds (2026-10-11 23:40:57 +0200)

----------------------------------------------------------------

Wadim Mueller (1):
prserv: commit new revisions when a request succeeds

 lib/prserv/serv.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
#1 lore raw

[bitbake][scarthgap][2.8][PATCH 1/1] prserv: commit new revisions when a request succeeds

From: Wadim Mueller <[email protected]>

PRServerClient.dispatch_message() is meant to commit new PR values after every request that succeeds:

try:
return await super().dispatch_message(msg)
except:
self.server.table.sync()
raise
else:
self.server.table.sync_if_dirty()

The else clause of a try statement does not run when the try suite leaves through a return statement, so sync_if_dirty() is never called after a successful request. The database connection keeps an open EXCLUSIVE transaction and the values are written to the database file only when the server stops or receives a signal. Until then the file stays unchanged and other readers fail with "database is locked".

A long running server therefore holds all revisions it has handed out since its start only in memory. After a crash, a kill or a power loss the file returns to the state of the last clean stop, the numbering restarts there and a client sees package revisions go backwards.

Reproduced with a server started with --file on an empty database: three getPR() calls for new checksums leave the file untouched until the server is stopped. With this change the entries are in the file after each request.

Keep the response, commit, then return it.

This is specific to the 2.8 branch. The server was reworked for master and 2.10 ("prserv: enable database sharing" and the commits around it), which commits where values are stored and uses WAL, so master does not have this problem and the commit cannot be backported as it is.

---
 lib/prserv/serv.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
lib/prserv/serv.py +3 -3
index dc4be5b62..cff57a8cc 100644
@@ -39,12 +39,12 @@ class PRServerClient(bb.asyncrpc.AsyncServerConnection):
 
     async def dispatch_message(self, msg):
         try:
-            return await super().dispatch_message(msg)
+            response = await super().dispatch_message(msg)
         except:
             self.server.table.sync()
             raise
-        else:
-            self.server.table.sync_if_dirty()
+        self.server.table.sync_if_dirty()
+        return response
 
     async def handle_test_pr(self, request):
         '''Finds the PR value corresponding to the request. If not found, returns None and doesn't insert a new value'''