]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
bitbake-worker: Guard against multiprocessing corruption of event data
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 29 Sep 2015 08:28:24 +0000 (09:28 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 29 Sep 2015 13:11:13 +0000 (14:11 +0100)
commit3cb55bdf06148943960e438291f9a562857340a3
treece15f58c97bc70795ead9197f9a735036a5c8159
parent139e851831eea682aba0f9403dcc2eea7c1b05bd
bitbake-worker: Guard against multiprocessing corruption of event data

In the forked child, we may use multiprocessing. There is only one event
pipe to the worker controlling process and if we're unlucky, multiple
processes can write to it at once corrupting the data by intermixing it.

We don't see this often but when we do, its quite puzzling. I suspect it
only happens in tasks which use multiprocessng (do_rootfs, do_package)
and is much more likely to happen when we have long messages, usually many
times PAGE_SIZE since PAGE_SIZE writes are atomic. This makes it much more
likely within do_roofs, when for example a subprocess lists the contents
of a rootfs.

To fix this, we give each child a Lock() object and use this to serialise
writes to the controlling worker.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bin/bitbake-worker