Multiple bitbake and a shared DL_DIR location - race conditions?
Hello,
in setting up a few automated builds, I have shared the DL_DIR amongst the builds.
I would like to allow the builds to overlap in time, at least make sure the builds are robust to this, but I doubt this is possible at all.
Are there any race conditions with the current approach?
I.e. what if two fetch tasks from concurrent instances of bitbake decide to download a package?
Regards,
Signature · 1 line
Leon
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Leon Woestenberg schreef:
| Hello, | | in setting up a few automated builds, I have shared the DL_DIR amongst | the builds. | | I would like to allow the builds to overlap in time, at least make | sure the builds are robust to this, but I doubt this is possible at | all. | | Are there any race conditions with the current approach? | | I.e. what if two fetch tasks from concurrent instances of bitbake | decide to download a package?
Isn't that what the .lock files are supposed to do? If you have multiple bitbake threads (in one bitbake instance) it has to solve the same problem.
regards,
Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
iD8DBQFHyvP0MkyGM64RGpERAj7vAJ9KmIc0oFcjHPAnjgTz7r6ZUTreoQCeOPQe DTwR/YsH45qrnBCL9tOme7A=
=E8Ty
-----END PGP SIGNATURE-----
Hello Koen,
Quoted 9 lines
| I would like to allow the builds to overlap in time, at least make | sure the builds are robust to this, but I doubt this is possible at | all. | | Are there any race conditions with the current approach? | | I.e. what if two fetch tasks from concurrent instances of bitbake | decide to download a package?
Quoted 3 lines
Isn't that what the .lock files are supposed to do? If you have multiple bitbake threads (in one bitbake instance) it has to solve the same problem.
Maybe, I did not fully understand how the go() function in "lib/bb/fetch/__init__.py" could handle this case:
Suppose at time T one bitbake instance #1 is downloading/fetching package A, and bitbake instance #2 at time T would like to fetch the same package, what will #2 do?
Will it wait for the lock to be released, then check?
Regards,
Signature · 1 line
Leon
Quoted 14 lines · Leon Woestenberg
Hello Koen,
Quoted 9 lines
| I would like to allow the builds to overlap in time, at least make | sure the builds are robust to this, but I doubt this is possible at | all. | | Are there any race conditions with the current approach? | | I.e. what if two fetch tasks from concurrent instances of bitbake | decide to download a package?Quoted 3 lines
Isn't that what the .lock files are supposed to do? If you have multiple bitbake threads (in one bitbake instance) it has to solve the same problem.
Quoted 8 lines
Maybe, I did not fully understand how the
go()function in "lib/bb/fetch/__init__.py" could handle this case:Suppose at time T one bitbake instance #1 is downloading/fetching package A, and bitbake instance #2 at time T would like to fetch the same package, what will #2 do?
Will it wait for the lock to be released, then check?
Yes, it should but see my comment about scm checkouts too. Ultimately I'd like bitbake to have more awareness of locks and take it into account when scheduling tasks. In reality I'll settle for it working without races at the moment ;-).
Cheers,
Richard
Quoted 11 lines · Leon Woestenberg
in setting up a few automated builds, I have shared the
DL_DIRamongst the builds.I would like to allow the builds to overlap in time, at least make sure the builds are robust to this, but I doubt this is possible at all.
Are there any race conditions with the current approach?
I.e. what if two fetch tasks from concurrent instances of bitbake decide to download a package?
Each file in DL_DIR has a .lock file which bitbake has to acquire before it will actually make the transfer. DL_DIR itself is therefore safe.
What might not be safe is the cvs/svn/git subdirs underneath this since you could have two recipes trying to get different revisions of the same repository which would go to different files in DL_DIR but use the same scm directory. One solution is to override SVNDIR/GITDIR/CVSDIR.
Cheers,
Richard
Richard,
Quoted 3 lines · Richard Purdie
repository which would go to different files in
DL_DIRbut use the same scm directory. One solution is to override SVNDIR/GITDIR/CVSDIR.
bitbake.conf:143:DL_DIR = "${TMPDIR}/downloads"
bitbake.conf:144:CVSDIR = "${DL_DIR}/cvs"
bitbake.conf:145:SVNDIR = "${DL_DIR}/svn"
bitbake.conf:146:GITDIR = "${DL_DIR}/git"
Can we change this into:
DL_DIR = "${TMPDIR}/downloads"CO_DIR = "${DL_DIR}"
CVSDIR = "${CO_DIR}/cvs"
SVNDIR = "${CO_DIR}/svn"
GITDIR = "${CO_DIR}/git"
So that I can override CO_DIR robustly, even when a fourth revision control system comes into play?
(CO_DIR as in checkout directory)
Regards,
Signature · 1 line
Leon
Quoted 17 lines · Leon Woestenberg
Quoted 3 lines · Richard Purdie
repository which would go to different files in
DL_DIRbut use the same scm directory. One solution is to override SVNDIR/GITDIR/CVSDIR.bitbake.conf:143:DL_DIR = "${TMPDIR}/downloads"
bitbake.conf:144:CVSDIR = "${DL_DIR}/cvs"
bitbake.conf:145:SVNDIR = "${DL_DIR}/svn"
bitbake.conf:146:GITDIR = "${DL_DIR}/git"Can we change this into:
DL_DIR= "${TMPDIR}/downloads"CO_DIR= "${DL_DIR}"
CVSDIR = "${CO_DIR}/cvs"
SVNDIR = "${CO_DIR}/svn"
GITDIR = "${CO_DIR}/git"
Quoted 4 lines
So that I can override
CO_DIRrobustly, even when a fourth revision control system comes into play?(
CO_DIRas in checkout directory)
I agree with that change, it makes sense. Do you want to check it in or should I?
Cheers,
Richard
Hello Richard,
Quoted 15 lines · Richard Purdie
Quoted 13 lines · Leon Woestenberg
bitbake.conf:143:DL_DIR = "${TMPDIR}/downloads"
bitbake.conf:144:CVSDIR = "${DL_DIR}/cvs"
bitbake.conf:145:SVNDIR = "${DL_DIR}/svn"
bitbake.conf:146:GITDIR = "${DL_DIR}/git"Can we change this into:
DL_DIR= "${TMPDIR}/downloads"CO_DIR= "${DL_DIR}"
CVSDIR = "${CO_DIR}/cvs"
SVNDIR = "${CO_DIR}/svn"
GITDIR = "${CO_DIR}/git"
Quoted 8 lines
Quoted 4 lines
So that I can override
CO_DIRrobustly, even when a fourth revision control system comes into play?(
CO_DIRas in checkout directory)I agree with that change, it makes sense. Do you want to check it in or should I?
I will test it first, then check-in (unless you have done so already, lacking my response).
Regards,
Signature · 1 line
Leon