Bug 8259

Summary: bitbake hangs if PRSERV_HOST=localhost is specified but server is not running
Product: [Build System, Metadata & Runtime] BitBake Reporter: Leonardo Sandoval Gonzalez <leonardo.sandoval.gonzalez>
Component: bitbakeAssignee: Mariano Lopez <mariano.lopez>
Status: VERIFIED OBSOLETE QA Contact: Alexandru Georgescu <alexandru.c.georgescu>
Severity: normal    
Priority: Medium+ CC: alexandru.c.georgescu, benjamin.esquivel, poky.bs.watcher, poky.watcher
Version: 1.8   
Target Milestone: 2.0   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Leonardo Sandoval Gonzalez 2015-09-04 21:25:36 UTC
In case there is no server running (daemon), and variable PRSERV_HOST is present, when running a'bitbake <target>' it hangs with the following log:

Delaying shutdown due to active processes which appear to be holding bitbake.lock:
COMMAND   PID     USER   FD   TYPE DEVICE SIZE/OFF        NODE NAME
python  18299 lsandov1   12u   REG    8,4        0 30090935242 /home/lsandov1/poky/build/bitbake.lock
.
.
.

Steps to reproduce

1. echo "PRSERV_HOST=\"localhost:8585\"" >> conf/local.conf

#make sure you do not run the bitbake-prserv or the daemon is not already running (ps aux | grep bitbake-prserv)

2. bitbake <anytarget>


What it is expected is to exit immediately to the command line, instead of showing the log and hanging there.
Comment 1 Leonardo Sandoval Gonzalez 2015-09-04 21:29:02 UTC
Also, if one suspends (control + z) when it is hanging, multiple bitbake-prserv process are observed:

lsandov1@yctb05:~/poky/build> ps axu | grep bitbake
lsandov1 18248  0.3  0.0 124392 27140 pts/34   T    13:09   0:02 python /home/lsandov1/poky/bitbake/bin/bitbake prserv-test
lsandov1 18268  0.1  0.0 196428 30032 pts/34   T    13:09   0:00 python /home/lsandov1/poky/bitbake/bin/bitbake prserv-test
lsandov1 18299  0.8  0.0 211084 43500 pts/34   Tl   13:09   0:05 python /home/lsandov1/poky/bitbake/bin/bitbake prserv-test
.
.
.
.
Comment 2 Mariano Lopez 2015-09-25 17:34:59 UTC
This is not reproducible on master anymore.

It seems this change in cooker solved the issue:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/bitbake/lib/prserv/serv.py?id=85256c8fa986f2a3258e75a22bb8d0656ffa41bf

It is not reproducible in master anymore but if return to a commit before the change in cooker, the issue is there.
Comment 3 Alexandru Georgescu 2015-10-23 07:01:44 UTC
verified as per above comments.