All of lore.kernel.org
 help / color / mirror / Atom feed
From: <huong4.nguyenthi@toshiba.co.jp>
To: Tim.Bird@sony.com
Cc: fuego@lists.linuxfoundation.org, TSDVGroup1skerlet@ml.toshiba.co.jp
Subject: Re: [Fuego] [fuego-core 2/7] ftc: fix test process is not killed when fuego test times out
Date: Mon, 26 Jul 2021 08:29:20 +0000	[thread overview]
Message-ID: <OSBPR01MB219745662E24C0F715A0198C9CE89@OSBPR01MB2197.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <BYAPR13MB250361EA5AB6F581C7A6C137FDE49@BYAPR13MB2503.namprd13.prod.outlook.com>

Dear Tim,

Thanks for your feedback.

The function handle timeout event so I think send SIGALARM is more reasonable.
Test driver or subprocesses will decide what to do with timeout signal.

For now, SIGALARM is trapped in fuego functions.sh
Signal handler will do post_tests and processing before exiting main process
When main process exit, all subprocesses that belong to group process will be exited.

Best Regards,
Huong
-----Original Message-----
From: Tim.Bird@sony.com <Tim.Bird@sony.com> 
Sent: Friday, July 23, 2021 1:35 AM
To: pyla venkata(TSIP) <Venkata.Pyla@toshiba-tsip.com>
Cc: nguyen thi huong(TSDV Eng 1) <huong4.nguyenthi@toshiba.co.jp>; sangorrin daniel(サンゴリン ダニエル □SWC◯ACT) <daniel.sangorrin@toshiba.co.jp>; fuego@lists.linuxfoundation.org
Subject: RE: [fuego-core 2/7] ftc: fix test process is not killed when fuego test times out

OK - I have a question on this one.

> -----Original Message-----
> From: venkata.pyla@toshiba-tsip.com <venkata.pyla@toshiba-tsip.com>
> 
> From: nguyen thi huong <huong4.nguyenthi@toshiba.co.jp>
> 
> - Currently, fuego kill main process and does not kill test process when test times out
>   In that case, test process still runs but fuego test result is not 
> available
> - Revise implementation to kill all test processes and printout the 
> result
> 
> Signed-off-by: nguyen thi huong <huong4.nguyenthi@toshiba.co.jp>
> Signed-off-by: venkata pyla <venkata.pyla@toshiba-tsip.com>
> ---
>  scripts/ftc | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/ftc b/scripts/ftc index 2a6a640..5c300d0 100755
> --- a/scripts/ftc
> +++ b/scripts/ftc
> @@ -3914,7 +3914,7 @@ def ftc_exec_command(command, timeout):
> 
>      dprint("ftc_exec_command: command=%s" % command)
> 
> -    p = subprocess.Popen(command.split(), stdout=log, stderr=log)
> +    p = subprocess.Popen(command.split(), stdout=log, stderr=log, 
> + preexec_fn=os.setpgrp)
> 
>      # specify timeout for command operation
>      signal.signal(signal.SIGALRM, alarm_handler) @@ -3960,7 +3960,8 
> @@ def ftc_exec_command(command, timeout):
>          #    p.kill()
> 
>          # abort with prejudice...
> -        p.kill()
> +        pgrp = os.getpgid(p.pid)
> +        os.killpg(pgrp, signal.SIGALRM)

Why are you sending a SIGALARM instead of a SIGKILL?
This is a weaker signal, that can be ignored or masked.

>          timed_out = True
> 
>      finally:
> --
> 2.20.1
> 

I've applied this patch, but I'd like to know if you have some reason for weakening the signal sent to kill the process.

Thanks.
 -- Tim



  reply	other threads:[~2021-07-26  8:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-18 11:10 [Fuego] [fuego-core 0/7] upstreaming work venkata.pyla
2021-07-18 11:10 ` [Fuego] [fuego-core 1/7] ftc: docker ps will not work on the local board venkata.pyla
2021-07-22 18:28   ` Tim.Bird
2021-07-18 11:10 ` [Fuego] [fuego-core 2/7] ftc: fix test process is not killed when fuego test times out venkata.pyla
2021-07-22 18:34   ` Tim.Bird
2021-07-26  8:29     ` huong4.nguyenthi [this message]
2021-07-18 11:10 ` [Fuego] [fuego-core 3/7] testplan_smoketest.json: ftc fails to add job for tesplan_smoketest venkata.pyla
2021-07-22 18:49   ` Tim.Bird
2021-07-18 11:10 ` [Fuego] [fuego-core 4/7] LTP: Add the new tests and skip non-installed tests venkata.pyla
2021-07-22 18:54   ` Tim.Bird
2021-07-18 11:10 ` [Fuego] [fuego-core 5/7] LTP: fix fuego test could not skip list of test cases venkata.pyla
2021-07-22 18:55   ` Tim.Bird
2021-07-18 11:10 ` [Fuego] [fuego-core 6/7] LTP: execute all tests when spec specifies "all" venkata.pyla
2021-07-22 19:03   ` Tim.Bird
2021-07-27  3:11     ` [Fuego] Trả lời: " tho1.nguyendat
2021-07-27 23:00       ` Tim.Bird
2021-07-28  0:42         ` [Fuego] Trả lời: " tho1.nguyendat
2021-07-28 22:10           ` Tim.Bird
2021-07-18 11:10 ` [Fuego] [fuego-core 7/7] LTP: automatically obtain the list of tests venkata.pyla
2021-07-22 20:18   ` Tim.Bird
2021-07-20 20:58 ` [Fuego] [fuego-core 0/7] upstreaming work Tim.Bird

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=OSBPR01MB219745662E24C0F715A0198C9CE89@OSBPR01MB2197.jpnprd01.prod.outlook.com \
    --to=huong4.nguyenthi@toshiba.co.jp \
    --cc=TSDVGroup1skerlet@ml.toshiba.co.jp \
    --cc=Tim.Bird@sony.com \
    --cc=fuego@lists.linuxfoundation.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 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.