Bug 6752 - bitbake-prserv-tool has issues when it comes to exporting the PR database
Summary: bitbake-prserv-tool has issues when it comes to exporting the PR database
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 1.7
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.8
Assignee: Chong Lu
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks: 7734
  Show dependency tree
 
Reported: 2014-09-23 13:11 UTC by Costin
Modified: 2015-05-13 13:23 UTC (History)
5 users (show)

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


Attachments
lsof result file (3.50 KB, text/plain)
2014-09-25 19:24 UTC, Costin
no flags Details
ps output during lsof (13.08 KB, text/plain)
2014-09-25 19:24 UTC, Costin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Costin 2014-09-23 13:11:40 UTC
Hello,

While performing weekly tests, for TC 930 and TC931 there is a step "bitbake-prserv-tool export export.inc" where the PR database should be exported. 

The error I encounter is:

$ bitbake-prserv-tool export export.inc
ERROR: Only one copy of bitbake should be run against a build directory

However I can see nothing when performing:
$ ps -eaf | grep bitbake
cosscat  12503 32509  0 09:00 pts/4    00:00:00 grep --color=auto bitbake
$ ps -eaf | grep python
cosscat  12505 32509  0 09:00 pts/4    00:00:00 grep --color=auto python

poky : 7d80f8e9468253496a7097685aac8f468940a9c5

Thank you,

Costin
Comment 1 Richard Purdie 2014-09-23 21:43:46 UTC
If would be helpful to see all the processes, to see that error, there must be some process holding the lockfile open. "lsof bitbake.lock" should show up which processes are using it too.
Comment 2 Costin 2014-09-25 19:24:04 UTC
Created attachment 2142 [details]
lsof result file
Comment 3 Costin 2014-09-25 19:24:40 UTC
Created attachment 2143 [details]
ps output during lsof
Comment 4 Costin 2014-09-25 19:26:23 UTC
Hello,

Attached are two files, one containing the result of "lsof bitbake.lock" named lsof.txt and the other containing the selection for related processes resutlt of "ps -eaf" during the lsof command named ps_while_lsof.txt.

before and after issuing "bitbake-prserv-tool export export.inc" there is no result returned by lsof.

Thank you,

Costin
Comment 5 Costin 2014-12-10 09:55:38 UTC
Hello,

Just performed tests for the new 1.8 build:

Build Configuration:
BB_VERSION        = "1.25.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Fedora-20"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.7"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "master:b813bdebb36501500e86fea5f7e15b4b15ea0902"

The issue is "resolved" in a way (tested on Fedora-20 and Ubuntu 14.10):

- on Fedora (with PR active):
 --> build m4 (bitbake m4) --> check PR (ls tmp/deploy/rpm/i586/m4* and result is m4*-r0.0.i586.rpm) --> modify m4 recipe (vi ../meta/recipes-devtools/m4/m4_1.4.17.bb) --> build m4 and check new PR (result: m4*-r0.1.i586.rpm; ok untill now) --> export db (bitbake-prserv-tool export export.inc, all goes well) --> rm db file (rm cache/prserv.sqlite3) --> import db (bitbake-prserv-tool export export.inc, and apparently all is well) --> modify m4 recipe && build m4 --> check PR ... and it is reset to 0 (result: m4*-r0.0.i586.rpm)

I tried the above steps for few times and in the end i got (the export part is well however no matter how many times i perform it):
[cosscat@Fedora-CCC build]$ bitbake-prserv-tool import export.inc
ERROR: Only one copy of bitbake should be run against a build directory
Importing from file export.inc failed!
[cosscat@Fedora-CCC build]$ 

However the good thing is that this time it didn't displayed the message above from the start and I could do export/import of db few times

- on Ubuntu (with PR active):
performed all the above and same thing happens with the exception that the "ERROR*" message is not encountered


Costin
Comment 6 Costin 2015-01-12 11:32:55 UTC
Hello,

The already described behavior is valid for this week's commit:

1.7.1_RC1: 6dd21a9f152a93e2df1178d7a5bd903d7edcf4be

Costin
Comment 7 Chong Lu 2015-01-19 08:45:46 UTC
I think this issue is caused by syncing database after thread quit. I will send a patch.
Comment 8 Costin 2015-01-20 10:04:32 UTC
Hello,

still present in d9d5b8b499af3ae01a1e33d0d3969c54c2d4ab1b
Comment 9 Richard Purdie 2015-01-30 14:39:32 UTC
The patch for the thread issue was merged in http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=8da8a0e55e7191b81e6e0fd1d2d4f0937ba7b0ac
Comment 10 Richard Purdie 2015-01-30 14:59:05 UTC
Marking as resolved as I think this is fixed now (couldn't reproduce it locally myself). Please reopen if the same error occurs.