I'm fairly sure that these bugs which appear in the Python plugin:
https://bugzilla.redhat.com/show_bug.cgi?id=1566516
https://bugzilla.redhat.com/show_bug.cgi?id=1566522
are really bugs in the SERIALIZE_ALL_REQUESTS thread model. See
the first patch for the full explanation.
The second patch is a fix for a race condition which is probably
nudged into being by the first patch.
Now this all works, EXCEPT it quite reliably breaks either the NBD
plugin or ‘tests/test-parallel-nbd.sh’. I have no idea why because as
far as I know the change should not affect the NBD plugin or that test
in any way. Unfortunately both are rather complex to debug.
Rich.