mirror of
https://git.yoctoproject.org/poky
synced 2026-11-26 05:56:57 +00:00
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.
(Bitbake rev: 6b443060ee96a62efb94723c97f22b51c9b20507)
Signed-off-by: Wadim Mueller <wafgo01@gmail.com>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Paul Barker <paul@pbarker.dev>
Bitbake
=======
BitBake is a generic task execution engine that allows shell and Python tasks to be run
efficiently and in parallel while working within complex inter-task dependency constraints.
One of BitBake's main users, OpenEmbedded, takes this core and builds embedded Linux software
stacks using a task-oriented approach.
For information about Bitbake, see the OpenEmbedded website:
https://www.openembedded.org/
Bitbake plain documentation can be found under the doc directory or its integrated
html version at the Yocto Project website:
https://docs.yoctoproject.org
Bitbake requires Python version 3.8 or newer.
Contributing
------------
Please refer to our contributor guide here: https://docs.yoctoproject.org/contributor-guide/
for full details on how to submit changes.
As a quick guide, patches should be sent to bitbake-devel@lists.openembedded.org
The git command to do that would be:
git send-email -M -1 --to bitbake-devel@lists.openembedded.org --subject-prefix='2.8][PATCH'
If you're sending a patch related to the BitBake manual, make sure you copy
the Yocto Project documentation mailing list:
git send-email -M -1 --to bitbake-devel@lists.openembedded.org --cc docs@lists.yoctoproject.org
Mailing list:
https://lists.openembedded.org/g/bitbake-devel
Source code:
https://git.openembedded.org/bitbake/
Testing
-------
Bitbake has a testsuite located in lib/bb/tests/ whichs aim to try and prevent regressions.
You can run this with "bitbake-selftest". In particular the fetcher is well covered since
it has so many corner cases. The datastore has many tests too. Testing with the testsuite is
recommended before submitting patches, particularly to the fetcher and datastore. We also
appreciate new test cases and may require them for more obscure issues.
To run the tests "zstd" and "git" must be installed.
The assumption is made that this testsuite is run from an initialized OpenEmbedded build
environment (i.e. `source oe-init-build-env` is used). If this is not the case, run the
testsuite as follows:
export PATH=$(pwd)/bin:$PATH
bin/bitbake-selftest
The testsuite can alternatively be executed using pytest, e.g. obtained from PyPI (in this
case, the PATH is configured automatically):
pytest