Bug 5236

Summary: bitbake process hangs when invalid PR Server address provided
Product: [Build System, Metadata & Runtime] BitBake Reporter: Stoicescu Cornel <corneliux.stoicescu>
Component: bitbakeAssignee: valentin <valentin.popa>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jessica.zhang, poky.bs.watcher, poky.watcher, richard.purdie
Version: 1.5   
Target Milestone: 1.5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Stoicescu Cornel 2013-09-19 14:38:51 UTC
poky master:853bc53cd58a621918f0e5ce662dba263d1befb4

1) get poky, source environment
2) issue command 'bitbake man'
3) add in local.conf: PRSERV_HOST = "127.0.0.1:1234"
4) issue command 'bitbake man'

Notice error:
ERROR: PRservice 127.0.0.1:1234 not available

5) again, issue the command 'bitbake man'

Notice error:
ERROR: Only one copy of bitbake should be run against a build directory

6) issue command 'ps aux | grep bitbake' 

Notice bitbake process hanged:
cornel@NODE2:~/work/poky/build$ ps aux | grep bitbake
cornel   22225  100  0.1  51208 14784 pts/0    R    18:55   2:04 python /home/cornel/work/poky/bitbake/bin/bitbake-worker decafbad
cornel   22232  0.0  0.0  15100   996 pts/0    S+   18:57   0:00 grep --color=auto bitbake
cornel@NODE2:~/work/poky/build$
Comment 1 Richard Purdie 2013-10-04 14:51:22 UTC
I tried this on the revision of poky mentioned and on master and could not reproduce it. Can you double check this reproduces please?
Comment 2 Stoicescu Cornel 2013-10-04 15:21:05 UTC
New steps to reproduce:
1) Set up 2 poky environments
2) in the first poky environment issue command: bitbake-prserv --start
3) in the second poky environment add in local.conf: PRSERV_HOST = "127.0.0.1:8585"
4) in the second poky environment, issue command: bitbake man
     - you can cancel the build once is starts executing tasks
5) in the first poky environment, issue command: bitbake-prserv --stop
6) in the second poky environment issue command: bitbake man
     - notice (correct) error:
 ERROR: PRservice 127.0.0.1:8585 not available
6) in the second poky environment, issue again the command: bitbake man
     - notice error:
ERROR: Only one copy of bitbake should be run against a build directory


NOTE:
cornel@NODE1:~/SSD/poky/2build$ ps aux | grep bitbake
cornel   31695 97.9  0.1  51124 14932 pts/4    R    18:20   0:24 python /home/cornel/SSD/poky/bitbake/bin/bitbake-worker decafbad
Comment 3 valentin 2013-10-04 15:25:40 UTC
Hi Richard,
I could also reproduce this on my tree by sending SIGINT (CTRL+C) while running the first "bitbake man". Then add the server address in local.conf and run "bitbake man" again.
The problem seems to be that shutdown() from cooker.py returns premature because self.toparse is not initialized.
Do you have any sugestions of how to fix this problem?
Comment 4 valentin 2013-10-17 11:10:56 UTC
This issue doesn't reproduce on master anymore due to Richard's fix: 3ca820de91c2456a1b1c44022072f6ce7aa21344.
Thanks for the help Richard!
Comment 5 Stoicescu Cornel 2013-10-17 11:19:20 UTC
Verified in master:529bf977e956175bd8405ebffc88194192e44740

Note: This has not made it into the 1.5 dora release.