[Yum-devel] [PATCH 3/3] If the lock owner has gone, don't wait for it.

seth vidal skvidal at fedoraproject.org
Tue Aug 17 14:12:17 UTC 2010


On Mon, 2010-08-16 at 17:44 -0400, James Antill wrote:

ACK

> ---
>  utils.py   |    3 ++-
>  yummain.py |    6 ++++--
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/utils.py b/utils.py
> index 868e5cc..aad1b73 100644
> --- a/utils.py
> +++ b/utils.py
> @@ -103,7 +103,7 @@ def get_process_info(pid):
>  def show_lock_owner(pid, logger):
>      ps = get_process_info(pid)
>      if not ps:
> -        return
> +        return None
>  
>      # This yumBackend isn't very friendly, so...
>      if ps['name'] == 'yumBackend.py':
> @@ -121,6 +121,7 @@ def show_lock_owner(pid, logger):
>                      (time.ctime(ps['start_time']), ago))
>      logger.critical(_("    State  : %s, pid: %d") % (ps['state'], pid))
>  
> +    return ps
>  
> 
>  class YumUtilBase(YumBaseCli):
> diff --git a/yummain.py b/yummain.py
> index 95c7462..2892c34 100755
> --- a/yummain.py
> +++ b/yummain.py
> @@ -101,8 +101,10 @@ def main(args):
>                  logger.critical(lockerr)
>              if not base.conf.exit_on_lock:
>                  logger.critical(_("Another app is currently holding the yum lock; waiting for it to exit..."))
> -                show_lock_owner(e.pid, logger)
> -                time.sleep(2)
> +                tm = 0.1
> +                if show_lock_owner(e.pid, logger):
> +                    tm = 2
> +                time.sleep(tm)
>              else:
>                  logger.critical(_("Another app is currently holding the yum lock; exiting as configured by exit_on_lock"))
>                  return 1




More information about the Yum-devel mailing list