Hello, Álvaro and others!
Attached version feels stable enough so far - 20 builds in a row on
all CI variants (including 3 BSD) - no failures so far.
I updated the commit message to include reference to previous commits.
Also, tests designed in a way to fail fast if something is going wrong
+ log some debug information in that case (active queries with its
states).
Special tricks to handle forced-cache release builds included too.
Also, there is a test which "breaks" all the fixes - to ensure the
test actually catches them, not intended to be committed of course.
Best regards,
Mikhail.