Bug 7138 - bitbake -e with knotty spins if stdout is paginated
Summary: bitbake -e with knotty spins if stdout is paginated
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Low normal
Target Milestone: 1.8
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-01-14 10:09 UTC by Magnus Olsson
Modified: 2015-01-23 14:26 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Olsson 2015-01-14 10:09:16 UTC
I often use "bitbake -e core-image-minimal | less" to interactively grep for variable values etc. 

While 'less' is blocking stdout, bitbake will use 100% CPU on one core until I scroll to the end of output (or quit 'less' to break the pipe).

This is not a big deal, but if you like me keep one of these less-invokations running while writing recipes (to review variables), the CPU fan on my laptop will go nuts.

I use bitbake 1.22, but I was also able to reproduce this on bitbake master (1ea658dcdfde5465d3ecdb97550e0a66cb8b122e as of writing, 2015-01-14).

I expect bitbake with knotty UI to behave like other console programs, such as:

   python -c 'while True: print("foo")'  | less

.. which consumes no CPU while being blocked.
Comment 1 Richard Purdie 2015-01-21 16:39:12 UTC
Some notes on this. If you specify bitbake -t xmlrpc, the system doesn't show the problem. Its therefore something to do with the process backend.

It appears the cooker is trying to send an event to the client and the client is blocked sending data to the terminal. This leads to the event queue using a processor.
Comment 2 Richard Purdie 2015-01-21 17:44:34 UTC
I think I found the problem, a bogus fd in a select call. Patch on the bitbake list.