For the purposes of parallel repoman (bug 448462), cache modules like sqlite will need support for fork safety. In a forked process, it's not even safe to call sqlite3_close() on a file descriptor that was opened in a parent process: https://www.sqlite.org/howtocorrupt.html
Patches posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/c01d356208507e951f60a41061b33fba https://github.com/gentoo/portage/pull/600
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=d4f212def0dcba58e8a146daf8da7b481491de39 commit d4f212def0dcba58e8a146daf8da7b481491de39 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2020-08-08 01:00:50 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2020-08-09 02:41:43 +0000 sqlite: fork safety (bug 736334) Use a separate connection instance for each pid, since it is not safe to use a connection created in a parent process. See: https://www.sqlite.org/howtocorrupt.html Bug: https://bugs.gentoo.org/736334 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/portage/cache/sqlite.py | 9 +++++---- lib/portage/tests/dbapi/test_auxdb.py | 38 ++++++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 9 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c2610ab321d23a1f1d70cc7a550225c1213dbfa commit 5c2610ab321d23a1f1d70cc7a550225c1213dbfa Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2020-08-09 06:21:51 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2020-08-09 06:24:00 +0000 sys-apps/portage: Bump to version 3.0.2 #711174 Identified and fixed some FEATURES=compress-build-logs corruption issues #734990 Fix sync-rcu to recover from removed sync-rcu-store-dir #735626 Add example postsync hook to call egencache --update-pkg-desc-index #736334 Add fork safety to sqlite cache module Bug: https://bugs.gentoo.org/733180 Bug: https://bugs.gentoo.org/711174 Bug: https://bugs.gentoo.org/734990 Bug: https://bugs.gentoo.org/735626 Bug: https://bugs.gentoo.org/736334 Package-Manager: Portage-3.0.2, Repoman-2.3.23 Signed-off-by: Zac Medico <zmedico@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.2.ebuild | 263 ++++++++++++++++++++++++++++++++++ 2 files changed, 264 insertions(+)