[ovs-dev] [PATCH] ovs-check-dead-ifs: Tolerate processes that disappear during run.

Ethan Jackson ethan at nicira.com
Thu Jul 5 19:59:56 UTC 2012


Looks good to me, thanks.

Ethan

On Thu, Jul 5, 2012 at 12:58 PM, Ben Pfaff <blp at nicira.com> wrote:
> os.listdir("/proc/%d/fd" % pid) throws OSError if 'pid' died since the
> list of pids was obtained.
>
> Bug #12375.
> Reported-by: Amey Bhide <abhide at nicira.com>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  AUTHORS                         |    1 +
>  utilities/ovs-check-dead-ifs.in |    7 ++++++-
>  2 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/AUTHORS b/AUTHORS
> index 47f6ea3..bf8c149 100644
> --- a/AUTHORS
> +++ b/AUTHORS
> @@ -80,6 +80,7 @@ Alan Shieh              ashieh at nicira.com
>  Alban Browaeys          prahal at yahoo.com
>  Alex Yip                alex at nicira.com
>  Alexey I. Froloff       raorn at altlinux.org
> +Amey Bhide              abhide at nicira.com
>  André Ruß               andre.russ at hybris.com
>  Andreas Beckmann        debian at abeckmann.de
>  Atzm Watanabe           atzm at stratosphere.co.jp
> diff --git a/utilities/ovs-check-dead-ifs.in b/utilities/ovs-check-dead-ifs.in
> index 53185d6..9b806ed 100755
> --- a/utilities/ovs-check-dead-ifs.in
> +++ b/utilities/ovs-check-dead-ifs.in
> @@ -62,7 +62,12 @@ for pid in os.listdir("/proc"):
>      except ValueError:
>          continue
>
> -    for fd in os.listdir("/proc/%d/fd" % pid):
> +    try:
> +        fds = os.listdir("/proc/%d/fd" % pid)
> +    except OSError:
> +        continue
> +
> +    for fd in fds:
>          try:
>              fd = int(fd)
>          except ValueError:
> --
> 1.7.2.5
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list