All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Robert Yang <liezhi.yang@windriver.com>,
	bitbake-devel@lists.openembedded.org
Subject: Re: [RFC PATCH 1/3] bitbake: knotty.py: add MonitorDiskEvent and RecipeTaskPreProcess
Date: Thu, 13 Jul 2017 20:34:34 +0100	[thread overview]
Message-ID: <1499974474.30311.134.camel@linuxfoundation.org> (raw)
In-Reply-To: <3e7d971c-6183-487d-9a68-56b9e7212f5c@windriver.com>

On Wed, 2017-07-12 at 17:45 +0800, Robert Yang wrote:
> On 07/12/2017 06:56 AM, Richard Purdie wrote:
> > 
> > Do you know why we don't either always see these or always don't
> > see
> > them? I'm a bit worried there may be a deeper issue lurking here.
> > Are
> > those events part of the event mask being set?
> I digged this today, and find the reason, finally. It is harder than
> I had thought. Take MonitorDiskEvent as an example, the reproducer
> is:
> 
> In terminal 1:
> $ bitbake -m ; . ../poky/oe-init-build-env-memres . && bitbake world
> -k
> 
> In Terminal 2:
> $ bitbake --observe-only
> 
> Note, the time and order is very important, otherwise we can't
> reproduce
> the problem, we must run "bitbake target" in terminal 1 firstly, and
> then
> run "bitbake --observe-only" in terminal 2 after "cache loaded"
> before runqueue is ready, in another words, run "bitbake --observe-
> only"
> when "Initialising tasks" is displaying in terminal 1, no early or
> late,
> then we will see the error in terminal 2 (And only in terminal 2):
> 
> ERROR: Unknown event: <bb.event.MonitorDiskEvent object at
> 0x7f5c3776f940>
> 
> The "bitbake world" (first) does everything well, but "bitbake --
> observe-only"
> (second) doesn't becuase of the following code in lib/bb/main.py:
> 
>          try:
>              return ui_module.main(server_connection.connection, 
> server_connection.events,
>                                    configParams)
> 
> The second run of "ui_module.main()" sends server_connection.events 
> (bb.event.MonitorDiskEvent) which is prepared by first run, and
> knotty.py
> doesn't know how to handle it, and we will get the error. So we can't
> get the error if we run second bitbake earlier (the event is not
> ready)
> or later (the event had been handled by first bitbake).
> 
> I think that bb.event.RecipeTaskPreProcess is similar, add them
> to ignore list should be fine, and I will add these explanations to
> commit message.

I'm not sure I agree here, I think you're right that there is a race
issue however I'd rather solve any race issue than workaround it.
Whilst you need to add these events today, there are likely other
events which might appear tomorrow.

> > For reference, I've been looking at the server abstraction in
> > bitbake and am close to rewriting a large part of bb.server.* and
> > bb.main with a view to simplifying the code structure and making
> > things easier to understand.
> That's great, something var name is not easy for me to understand,
> for example, observe_only vs observer_only. And I think that we need
> a simple way to restart the server, something like bitbake --restart.
> 
> > 
> > 
> > I've noticed I see some new events with my change, equally I think
> > its
> > an event mask issue with my new code...
> > 
> > I pushed my changes onto http://git.yoctoproject.org/cgit.cgi/poky-
> > cont
> > rib/commit/?h=rpurdie/wip-
> > rss2&id=7d970e7b9f5499f5fcdb0e73246f106844ecf09b
> > however I am well aware things don't work properly yet and its full
> > of
> > debug. When finished I should be able to delete server/__init__.py
> > and
> > server/xmlrpc.py.
> I will hold on my patches until you've finished the rewriting, and
> please let me know if anything I can do.

The changes are now in master-next. I plan to split the patch up and
have been revising it a bit as I find issues. It would be great if you
could apply this locally and see if the issues you've found are still
present after this change and help with stressing the changes a bit,
see what issues we have?

One thing I know is probably broken at the moment is observe-only
unfortunately. I am tempted to merge the code changes I have as this
gives us a platform to build on which is much more understandable than
the existing codebase even if there are issues like that.

Cheers,

Richard




  reply	other threads:[~2017-07-13 19:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-11 10:27 [RFC PATCH 0/3] memres: fix for --observe-only Robert Yang
2017-07-11 10:27 ` [RFC PATCH 1/3] bitbake: knotty.py: add MonitorDiskEvent and RecipeTaskPreProcess Robert Yang
2017-07-11 22:56   ` Richard Purdie
2017-07-12  9:45     ` Robert Yang
2017-07-13 19:34       ` Richard Purdie [this message]
2017-07-14  1:57         ` Robert Yang
2017-07-14 10:27           ` Robert Yang
2017-07-17 10:39             ` Robert Yang
2017-07-18 22:02               ` Richard Purdie
2017-07-11 10:27 ` [RFC PATCH 2/3] bitbake: lib: fix --observe-only Robert Yang
2017-07-11 10:27 ` [RFC PATCH 3/3] bitbake: uihelper.py: check event.pid is present Robert Yang

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=1499974474.30311.134.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=liezhi.yang@windriver.com \
    /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.