[Yum-devel] [PATCH] Ignore lock held by zombie process. BZ 746004, 745281.
James Antill
james at fedoraproject.org
Mon Oct 17 15:00:17 UTC 2011
On Mon, 2011-10-17 at 14:02 +0200, Zdeněk Pavlas wrote:
> Zombies may never run and touch locked data again,
> so for all practical purposes, they don't exist.
> ---
> yum/__init__.py | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 1807d61..c3b5255 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -1900,6 +1900,12 @@ class YumBase(depsolve.Depsolve):
> msg = _('Unable to check if PID %s is active') % oldpid
> raise Errors.LockError(errno.EPERM, msg, oldpid)
> else:
> + try: st = open("/proc/%d/stat" % oldpid).read().split()[2]
> + except: st = None
> + if st == 'Z':
> + # The pid is a zombie.
> + self._unlock(lockfile)
> + continue
Where do we get zombies of extended lifetime (roll a d20 ;) from?
How good/compat. is that info. from stat vs. taking the line from
status?
Also, at least put this behind a "locker_alive" API call or something.
> # Another copy seems to be running.
> msg = _('Existing lock %s: another copy is running as pid %s.') % (lockfile, oldpid)
> raise Errors.LockError(0, msg, oldpid)
More information about the Yum-devel
mailing list