aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2024-02-09 09:19:54 -0800
committerZac Medico <zmedico@gentoo.org>2024-02-09 22:08:58 -0800
commitd7115d18dada572b6b10d6be30d0fa7fb325a2c8 (patch)
tree9678920a07654aac22f86fb6eea20e20ba3617a2 /bin
parentgpkg: Less aggressive subprocess.Popen kill in order to avoid BrokenPipeError (diff)
downloadportage-d7115d18dada572b6b10d6be30d0fa7fb325a2c8.tar.gz
portage-d7115d18dada572b6b10d6be30d0fa7fb325a2c8.tar.bz2
portage-d7115d18dada572b6b10d6be30d0fa7fb325a2c8.zip
GPG: Proactively stop to avoid "GPG keepalive failed" error in pypy ci jobs
This seems to help mitigate pypy ci job hangs like those fba76a545f2 triggered. Bug: https://bugs.gentoo.org/924192 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/quickpkg13
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/quickpkg b/bin/quickpkg
index 8443a00e6..c688c5312 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
import argparse
@@ -341,10 +341,6 @@ def quickpkg_main(options, args, eout):
portage.settings.features.remove("xattr")
portage.settings.lock()
- if portage.settings.get("BINPKG_GPG_SIGNING_KEY", None):
- gpg = GPG(portage.settings)
- gpg.unlock()
-
infos = {}
infos["successes"] = []
infos["missing"] = []
@@ -444,11 +440,18 @@ if __name__ == "__main__":
def sigwinch_handler(signum, frame):
lines, eout.term_columns = portage.output.get_term_size()
+ gpg = None
+ if portage.settings.get("BINPKG_GPG_SIGNING_KEY", None):
+ gpg = GPG(portage.settings)
+ gpg.unlock()
+
signal.signal(signal.SIGWINCH, sigwinch_handler)
try:
retval = quickpkg_main(options, args, eout)
finally:
os.umask(old_umask)
signal.signal(signal.SIGWINCH, signal.SIG_DFL)
+ if gpg is not None:
+ gpg.stop()
global_event_loop().close()
sys.exit(retval)