]> code.ossystems Code Review - openembedded-core.git/commit
sstate/staging: Handle directory creation race issue
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 Jun 2021 12:02:25 +0000 (13:02 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 2 Jul 2021 06:23:47 +0000 (07:23 +0100)
commit4f94d9296394bc7ce241439f00df86eb5912875f
tree41bb49a2f6cafa16cef5d04c1d63bfda342e903e
parent6f683cf21630142e82cc37d79f3d797d179d8d12
sstate/staging: Handle directory creation race issue

The sstate code tries to be careful about racing around directory creation.
In particular, the copyhardlinktree code creates the directory tree first
allowing for "already exists" errors and ignoring them, then hardlinks the
files in.

Unfortunately the sstate removal code can race against this since it
will try and remove empty directories. If there is some bad timing,
a newly created directory can be removed before it was populated, leading
to build failures.

We could try and add locking but this would damage performance, we've been
there before. It is also unclear where to actually place locks just based on
the contents of a manifest file which may cover multiple sstate install
locations for a given task.

Instead, lets disable directory removal in the problematic "shared" core
path. This could result in a few more empty directories being left on disk
but those should be harmless and better than locking hurting performance
or rare build races.

[YOCTO #13999]
[YOCTO #14379]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sstate.bbclass
meta/classes/staging.bbclass