All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH V2] memcg/functional: check several times if the process is killed
Date: Tue, 24 May 2016 14:26:55 +0200	[thread overview]
Message-ID: <20160524122655.GD10029@rei.lan> (raw)
In-Reply-To: <1464079938-32392-1-git-send-email-stanislav.kholmanskikh@oracle.com>

Hi!
> +	tpk_pid_exists=1
> +	for tpk_iter in $(seq 5); do
> +		tpk_state=$(ps -o state= -p $pid)
> +		if [ -z "$tpk_state" ] || echo "$tpk_state" | grep -q Z; then
> +			tpk_pid_exists=0
> +			break
> +		fi


We may also poke directly the /proc/$PID/ and /proc/$PID/status
something as (beware untested):

	if [ ! -d /proc/$PID/ ] || grep -q "Z (zombie)" /proc/$PID/status; then
		...
	fi

> +		sleep 1

And I would change this sleep to at least 1/4s so that we do not waste
too much time here.

> +	done
> +
> +	if [ $tpk_pid_exists -eq 0 ]; then
>  		wait $pid
>  		if [ $? -eq 1 ]; then
>  			result $FAIL "process $pid is killed by error"
> -- 
> 1.7.1
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2016-05-24 12:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-19 14:55 [LTP] [PATCH] memcg/functional: check several times if the process is killed Stanislav Kholmanskikh
2016-05-23 16:02 ` Cyril Hrubis
2016-05-23 16:25   ` Stanislav Kholmanskikh
2016-05-23 16:39     ` Cyril Hrubis
2016-05-23 17:43       ` Stanislav Kholmanskikh
2016-05-24  8:52         ` [LTP] [PATCH V2] " Stanislav Kholmanskikh
2016-05-24 12:26           ` Cyril Hrubis [this message]
2016-05-24  9:02   ` [LTP] [PATCH] " Jan Stancek
2016-05-24  9:18     ` Cyril Hrubis
2016-05-24 10:04       ` Stanislav Kholmanskikh
2016-05-24 10:15         ` Cyril Hrubis
2016-05-24 10:32           ` Jan Stancek
2016-05-24 10:48             ` Cyril Hrubis
2016-05-30 14:50               ` Stanislav Kholmanskikh

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=20160524122655.GD10029@rei.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.