From: Zac Medico <zmedico@gentoo.org>
To: Zac Medico <zmedico@gentoo.org>, gentoo-portage-dev@lists.gentoo.org
Subject: [gentoo-portage-dev] Re: [PATCH] EbuildIpc.communicate: lockfile PermissionDenied retry
Date: Sat, 6 Nov 2021 21:58:17 -0700 [thread overview]
Message-ID: <b43199ca-d22c-a98e-6631-5007a45d71fe@gentoo.org> (raw)
In-Reply-To: <20211104030935.10737-1-zmedico@gentoo.org>
[-- Attachment #1.1: Type: text/plain, Size: 1532 bytes --]
On 11/3/21 20:09, Zac Medico wrote:
> The lockfile function is expected to raise PermissionDenied if
> the (root) parent process holds the lock, so retry in this case.
>
> Bug: https://bugs.gentoo.org/468990
> Signed-off-by: Zac Medico <zmedico@gentoo.org>
> ---
> bin/ebuild-ipc.py | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/bin/ebuild-ipc.py b/bin/ebuild-ipc.py
> index 4999c043a..6eaa658a2 100755
> --- a/bin/ebuild-ipc.py
> +++ b/bin/ebuild-ipc.py
> @@ -158,7 +158,16 @@ class EbuildIpc:
> # Make locks quiet since unintended locking messages displayed on
> # stdout could corrupt the intended output of this program.
> portage.locks._quiet = True
> - lock_obj = portage.locks.lockfile(self.ipc_lock_file, unlinkfile=True)
> + # Acquire lock with PermissionDenied retry for bug #468990.
> + for _ in range(1000):
> + try:
> + lock_obj = portage.locks.lockfile(self.ipc_lock_file, unlinkfile=True)
> + except portage.exception.PermissionDenied:
> + time.sleep(0.1)
> + else:
> + break
> + else:
> + raise portage.exception.PermissionDenied(self.ipc_lock_file)
>
> try:
> return self._communicate(args)
>
Withdrawn in favor of this lockfile permission race fix:
https://archives.gentoo.org/gentoo-portage-dev/message/88916062415d9f692091dfb947f1bda2
--
Thanks,
Zac
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
prev parent reply other threads:[~2021-11-07 4:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-04 3:09 [gentoo-portage-dev] [PATCH] EbuildIpc.communicate: lockfile PermissionDenied retry Zac Medico
2021-11-07 4:58 ` Zac Medico [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b43199ca-d22c-a98e-6631-5007a45d71fe@gentoo.org \
--to=zmedico@gentoo.org \
--cc=gentoo-portage-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox