Bug 15657 - bitbaker server is reused even when branch is switched
Summary: bitbaker server is reused even when branch is switched
Status: RESOLVED NOTABUG
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 0.0.0
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2024-11-24 11:23 UTC by kweihmann
Modified: 2024-11-28 15:36 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kweihmann 2024-11-24 11:23:54 UTC
git -C /mnt/hdd/layer/poky/ checkout master && \
bitbake core-image-minimal -c listtasks && \
git -C /mnt/hdd/layer/poky/ checkout kirkstone && \
bitbake core-image-minimal -c listtasks

Loading cache: 100% |#########################################################################################################################################| Time: 0:00:00
Loaded 1880 entries from dependency cache.
Parsing recipes: 100% |#######################################################################################################################################| Time: 0:00:10
Parsing of 921 .bb files complete (1 cached, 920 parsed). 1880 targets, 51 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "2.9.1"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "x86_64-poky-linux"
MACHINE              = "qemux86-64"
DISTRO               = "poky"
DISTRO_VERSION       = "5.1"
TUNE_FEATURES        = "m64 core2"
TARGET_FPU           = ""
meta                 
meta-poky            
meta-yocto-bsp       = "master:88489115ae83f80f8f00f296f7f775ba24884744"

Sstate summary: Wanted 0 Local 0 Mirrors 0 Missed 0 Current 0 (0% match, 0% complete)###########################################################              | ETA:  0:00:00
Initialising tasks: 100% |####################################################################################################################################| Time: 0:00:00
NOTE: No setscene tasks
NOTE: Executing Tasks
do_build                              Default task for a recipe - depends on all other normal tasks required to 'build' a recipe
-- snip --
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.
Switched to branch 'kirkstone'
Your branch is up to date with 'origin/kirkstone'.

>> NOTE: Reconnecting to bitbake server...
>> NOTE: Retrying server connection (#1)...

Loading cache: 100% |#########################################################################################################################################| Time: 0:00:00
Loaded 1644 entries from dependency cache.
Parsing recipes: 100% |#######################################################################################################################################| Time: 0:00:04
Parsing of 883 .bb files complete (1 cached, 882 parsed). 1644 targets, 47 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "2.0.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "x86_64-poky-linux"
MACHINE              = "qemux86-64"
DISTRO               = "poky"
DISTRO_VERSION       = "4.0.22"
TUNE_FEATURES        = "m64 core2"
TARGET_FPU           = ""
meta                 
meta-poky            
meta-yocto-bsp       = "kirkstone:e4097c55d235a86c571239aa0ebc30d1a86f7f22"

Initialising tasks: 100% |####################################################################################################################################| Time: 0:00:00
Sstate summary: Wanted 0 Local 0 Mirrors 0 Missed 0 Current 0 (0% match, 0% complete)
NOTE: No setscene tasks
NOTE: Executing Tasks
do_build                              Default task for a recipe - depends on all other normal tasks required to 'build' a recipe
-- snip --
NOTE: Tasks Summary: Attempted 1 tasks of which 0 didn't need to be rerun and all succeeded.

the sequence should highlight that the bitbake-server process is reused, even
the branch has changed but the 2nd call has been fired within the original
servers timeout.

---
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
---

this log is a clear indicator (or more the absence of "NOTE: Starting bitbake server...") that the previous instance is still used.

IMO that causes changes to the bitbake-server to be not taken into account when
a sequence is fired within this timeout of the server.

That isn't problematic yet as only a few changes have been made to the application in recent times,
but it could turn into a problem once there are changes and users are coming from a branch/revision before that new change into the new (potentially breaking change), then it would still run with the old server, but with newer client code.

I think the bitbake version should be encoded into the lock file and sock file,
so the "old" server can timeout in the background while a matching one is started cleanly.
Comment 1 Richard Purdie 2024-11-27 22:50:11 UTC
In memory resident bitbake mode, changes to bitbake do not take effect to the currently memory resident version.

Swapping the branch out from under bitbake will change bitbake itself and that use case simply isn't supported and shouldn't be done. Use "bitbake -m" to unload first.
Comment 2 kweihmann 2024-11-28 03:42:12 UTC
How does one activate "-m" with e.g. bitbake-getvar (or any other tooling but bitbake itself)?
(That's how I came to this in the first place)
Comment 3 Richard Purdie 2024-11-28 11:09:54 UTC
bitbake -m would shut down any server so it would cover any tinfoil using tools, it doesn't need to be tool specific.
Comment 4 Randy MacLeod 2024-11-28 15:36:01 UTC
While there could be a warning or even an server exit, this is complicated and fragile so for now, not a bug.