Re: [gentoo-portage-dev] [PATCH 1/3] Add cached portage.getpid() function

2020-08-07 Thread Michał Górny
On Fri, 2020-08-07 at 21:08 -0700, Zac Medico wrote: > Since getpid is a syscall, cache results, and update them > via an after fork hook. > > Signed-off-by: Zac Medico > --- > lib/portage/__init__.py | 14 +++ > .../tests/process/test_AsyncFunction.py | 24

[gentoo-portage-dev] [PATCH 0/3] sqlite: fork safety (bug 736334)

2020-08-07 Thread Zac Medico
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 Zac Medico (3): Add cached portage.getpid() function sqlite: add lazy connection init

[gentoo-portage-dev] [PATCH 3/3] sqlite: fork safety (bug 736334)

2020-08-07 Thread Zac Medico
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 --- lib/portage/cache/sqlite.py | 9 +

[gentoo-portage-dev] [PATCH 1/3] Add cached portage.getpid() function

2020-08-07 Thread Zac Medico
Since getpid is a syscall, cache results, and update them via an after fork hook. Signed-off-by: Zac Medico --- lib/portage/__init__.py | 14 +++ .../tests/process/test_AsyncFunction.py | 24 +++ 2 files changed, 38 insertions(+) diff --git

[gentoo-portage-dev] [PATCH 2/3] sqlite: add lazy connection init

2020-08-07 Thread Zac Medico
Signed-off-by: Zac Medico --- lib/portage/cache/sqlite.py | 29 - 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/lib/portage/cache/sqlite.py b/lib/portage/cache/sqlite.py index 55ae8f0e5..0395dd516 100644 --- a/lib/portage/cache/sqlite.py +++

Re: [gentoo-portage-dev] [PATCH] lib/*: Fix useless-return

2020-08-07 Thread Zac Medico
On 8/7/20 12:06 PM, Aaron Bauman wrote: > * Python implies such things. Let's drop 'em and be consistent. > > Signed-off-by: Aaron Bauman > --- > lib/_emerge/EbuildPhase.py | 6 +++--- > lib/_emerge/resolver/output.py | 5 + > lib/portage/elog/mod_custom.py | 1 + >

[gentoo-portage-dev] [PATCH] lib/*: Fix useless-return

2020-08-07 Thread Aaron Bauman
* Python implies such things. Let's drop 'em and be consistent. Signed-off-by: Aaron Bauman --- lib/_emerge/EbuildPhase.py | 6 +++--- lib/_emerge/resolver/output.py | 5 + lib/portage/elog/mod_custom.py | 1 + lib/portage/elog/mod_echo.py | 4 ++-- lib/portage/elog/mod_mail.py | 2

Re: [gentoo-portage-dev] [PATCH] lib/*: Fix useless-return

2020-08-07 Thread Aaron Bauman
On Fri, Aug 07, 2020 at 12:28:04PM -0400, Aaron Bauman wrote: > * Python implies such things. Let's drop 'em and be consistent. > > Signed-off-by: Aaron Bauman > --- > "\\" | 20 > lib/_emerge/EbuildPhase.py | 6 +++--- >

Re: [gentoo-portage-dev] [PATCH] lib/*: Fix useless-return

2020-08-07 Thread Michał Górny
On Fri, 2020-08-07 at 12:28 -0400, Aaron Bauman wrote: > * Python implies such things. Let's drop 'em and be consistent. > > Signed-off-by: Aaron Bauman > --- > "\\" | 20 > lib/_emerge/EbuildPhase.py | 6 +++--- >

[gentoo-portage-dev] [PATCH] lib/*: Fix useless-return

2020-08-07 Thread Aaron Bauman
* Python implies such things. Let's drop 'em and be consistent. Signed-off-by: Aaron Bauman --- "\\" | 20 lib/_emerge/EbuildPhase.py | 6 +++--- lib/_emerge/resolver/output.py | 5 - lib/portage/elog/mod_custom.py | 1 -