All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mikko Rapeli <mikko.rapeli@linaro.org>
To: Alexander Kanavin <alex.kanavin@gmail.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 7/8] oeqa qemurunner.py: kill qemu if it hangs
Date: Thu, 9 Feb 2023 11:56:55 +0200	[thread overview]
Message-ID: <Y+TDZ95lZZKLqsTj@nuoska> (raw)
In-Reply-To: <CANNYZj9KXz8-d-LV+z1Pp7dLkt64C4VGM+CJmTii7Fsnsif2mw@mail.gmail.com>

Hi,

On Thu, Feb 09, 2023 at 10:45:36AM +0100, Alexander Kanavin wrote:
> Isn't the code waiting 5 seconds and then sending SIGKILL, regardless
> of whether SIGTERM was successful or not here?

Yes. Not nice but better than leaking the process completely.

> I would actually remove this function altogether. qemu process is
> started by runqemu and it's the job of that to clean up the actual
> qemu process properly.

It doesn't currently. Should the sigterm_handler() also use SIGKILL if
it has to?

Cheers,

-Mikko

> Alex
> 
> On Thu, 9 Feb 2023 at 09:10, Mikko Rapeli <mikko.rapeli@linaro.org> wrote:
> >
> > qemu doesn't always behave well and can hang too.
> > kill it with force if was still alive.
> >
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> > ---
> >  meta/lib/oeqa/utils/qemurunner.py | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
> > index bce00c696a..8e3484385d 100644
> > --- a/meta/lib/oeqa/utils/qemurunner.py
> > +++ b/meta/lib/oeqa/utils/qemurunner.py
> > @@ -589,6 +589,13 @@ class QemuRunner:
> >                  os.kill(self.qemupid, signal.SIGTERM)
> >              except ProcessLookupError as e:
> >                  self.logger.warning('qemu-system ended unexpectedly')
> > +            time.sleep(5)
> > +            try:
> > +                # qemu-system did not behave well
> > +                os.kill(self.qemupid, signal.SIGKILL)
> > +            except ProcessLookupError as e:
> > +                # already dead
> > +                pass
> >
> >      def stop_thread(self):
> >          if self.thread and self.thread.is_alive():
> > --
> > 2.34.1
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#176926): https://lists.openembedded.org/g/openembedded-core/message/176926
> > Mute This Topic: https://lists.openembedded.org/mt/96849162/1686489
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >


  reply	other threads:[~2023-02-09  9:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09  8:09 [PATCH v2 0/8] fix oeqa runtime test framework when qemu hangs Mikko Rapeli
2023-02-09  8:09 ` [PATCH v2 1/8] oeqa ssh.py: move output prints to new line Mikko Rapeli
2023-02-09  8:09 ` [PATCH v2 2/8] oeqa ssh.py: fix hangs in run() Mikko Rapeli
2023-02-09  9:15   ` [OE-core] " Richard Purdie
2023-02-09  9:36     ` Mikko Rapeli
2023-02-09 10:53       ` Alexander Kanavin
2023-02-09 10:56         ` Richard Purdie
2023-02-09 11:12         ` Mikko Rapeli
2023-02-09 11:42           ` Alexander Kanavin
2023-02-09 12:23             ` Mikko Rapeli
2023-02-09 10:20   ` Richard Purdie
2023-02-09 10:35     ` Mikko Rapeli
2023-02-09 10:52       ` Richard Purdie
2023-02-09  8:09 ` [PATCH v2 3/8] oeqa ssh.py: add connection keep alive options to ssh client Mikko Rapeli
2023-02-09  8:09 ` [PATCH v2 4/8] oeqa dump.py: add error counter and stop after 5 failures Mikko Rapeli
2023-02-09  8:09 ` [PATCH v2 5/8] oeqa qemurunner: read more data at a time from serial Mikko Rapeli
2023-02-09  8:09 ` [PATCH v2 6/8] oeqa qemurunner.py: add timeout to QMP calls Mikko Rapeli
2023-02-09  8:09 ` [PATCH v2 7/8] oeqa qemurunner.py: kill qemu if it hangs Mikko Rapeli
2023-02-09  9:45   ` [OE-core] " Alexander Kanavin
2023-02-09  9:56     ` Mikko Rapeli [this message]
2023-02-09 10:01       ` Alexander Kanavin
2023-02-09  8:09 ` [PATCH v2 8/8] oeqa qemurunner.py: try to avoid reading one character at a time Mikko Rapeli

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=Y+TDZ95lZZKLqsTj@nuoska \
    --to=mikko.rapeli@linaro.org \
    --cc=alex.kanavin@gmail.com \
    --cc=openembedded-core@lists.openembedded.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.