On 07.01.22 10:48, Konrad Weihmann wrote:
this should prevent running into the very rare error
sqlite3.OperationalError: attempt to write a readonly database

It's also possible that check_same_thread (that defaults to True ) in the sqlite3.connect causes this (see https://docs.python.org/3/library/sqlite3.html#sqlite3.connect) - I have too little experience with sqlite to provide any further input.

I'd be happy to get some feedback from users that do have that experience with sqlite in a highly multithreaded/multiprocess environment. Or by people that use cvecheck class in larger setups than just core.


As highlighted by https://www.sqlite.org/faq.html#q5
it is likely that the adapter won't allow use multiple exec calls
at the same time.

So it's best to prevent multiple accesses at a time, by reusing
the already in place CVE_CHECK_DB_FILE_LOCK

YOCTO #14110

Signed-off-by: Konrad Weihmann <[email protected]>
---
  meta/classes/cve-check.bbclass | 1 +
  1 file changed, 1 insertion(+)

diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass
index 70d1988a70..6c04ff9f09 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -111,6 +111,7 @@ python do_cve_check () {
  }
addtask cve_check before do_build after do_fetch
+do_cve_check[lockfiles] += "${CVE_CHECK_DB_FILE_LOCK}"
  do_cve_check[depends] = "cve-update-db-native:do_fetch"
  do_cve_check[nostamp] = "1"




-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#160252): 
https://lists.openembedded.org/g/openembedded-core/message/160252
Mute This Topic: https://lists.openembedded.org/mt/88258164/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to