All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Tanu Kaskinen <tanuk@iki.fi>, bitbake-devel@lists.openembedded.org
Subject: Re: Triggering graceful bitbake shutdown
Date: Fri, 04 Mar 2016 17:58:48 +0000	[thread overview]
Message-ID: <1457114328.2804.53.camel@linuxfoundation.org> (raw)
In-Reply-To: <1456836629.1737.41.camel@iki.fi>

Hi,

On Tue, 2016-03-01 at 14:50 +0200, Tanu Kaskinen wrote:
> I wrote a small script that runs bitbake sequentially with multiple
> MACHINE values. Sometimes I want to stop it with ctrl-c before it has
> finished, but it didn't work properly out-of-the box when running
> bitbake under the script (my script would not wait for bitbake to
> exit,
> and bitbake threw some backtrace too). I then modified SIGINT
> handling
> in my script so that it forwards the signal to bitbake and then waits
> for bitbake to exit. The problem is that bitbake ignores SIGINT. The
> UI
> handles python's KeyboardInterrupt exception, but that exception
> doesn't get raised when bitbake runs under my script. I don't know
> what
> triggers KeyboardInterrupt in normal conditions, since SIGINT doesn't
> seem to be sufficient, does python perhaps monitor stdin to catch the
> actual ctrl-c keypress?
> 
> Anyway, sending SIGTERM instead of SIGINT "works". However, the
> SIGTERM
> handler shuts down bitbake immediately rather than waiting for the
> current tasks to finish. Is that less safe than the normal ctrl-c
> handling? If the immediate shutdown is equally safe, then I have no
> problem, but if SIGTERM can cause state corruption so that resuming
> later doesn't work reliably, then I'd like to have some way for
> triggering graceful bitbake shutdown from my script. Any suggestions?
> 
> Or maybe there is already some way to run bitbake for multiple
> MACHINEs, and I don't need to write any script myself?

I'm curious which bitbake process you're sending SIGINT to. If its the
knotty UI, it should shutdown gracefully. Other pieces of the system
ignore SIGINT since we really want the UI to do it. The behaviour you
mention above sounds suboptimal though.

I'm a bit pushed for time with the release stablisation at the moment
but would love to see if there is something better we can do here...

Cheers,

Richard


  reply	other threads:[~2016-03-04 17:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 12:50 Triggering graceful bitbake shutdown Tanu Kaskinen
2016-03-04 17:58 ` Richard Purdie [this message]
2016-03-05 10:41   ` Tanu Kaskinen
2016-03-05 11:21     ` Tanu Kaskinen
2016-03-05 14:01       ` Tanu Kaskinen

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=1457114328.2804.53.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=tanuk@iki.fi \
    /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.