[Koha-devel] Deadlock issues when running the tests in parallel, and maybe not only in the tests?

Joonas Kylmälä joonas.kylmala at helsinki.fi
Tue May 25 17:54:36 CEST 2021


Hey Victor,

can you please check whether the $ENV{KOHA_TESTING} variable is set
correctly in your CI setup, and if it is not, does it fix the issue?
Please see the code in C4::Circulation::SendCirculationAlert(), it is
the only place where we do manual db locking as far as I know. It is
something we should fix by re-architecturing the message_queue database
table for digest messages. However, I'm interested in knowing if the
deadlocks now happen because of this and whether it is unit test
specific issue because at least based on the comments in
SendCirculationAlert() it appears to be so.

Regards,
Joonas

On 25/05/2021 18:45, Victor Grousset/tuxayo wrote:
> Hi :)
> 
> IIUC this is where the CI calls "prove" to run the tests
> https://gitlab.com/koha-community/koha-testing-docker/-/blob/master/files/run.sh#L213
> 
> 
> And this is the place where KOHA_PROVE_CPUS is set.
> https://gitlab.com/koha-community/koha-testing-docker/-/blob/master/files/run.sh#L155
> 
> It's not set in ".env" file so it should use "nproc" and this calls
> "prove" with more than one thread.
> 
> Is that really the case? I tried locally use to "prove -j 4" and I'm
> getting deadlocks with the database after a few minutes.
> 
> And do these deadlock in tests mean that Koha can hit them while running
> in production?
> 
> I expect the tests to fail due to messing up with each other data but a
> deadlock is something else.
> 
> 
> Cheers,
> 

-- 
Joonas Kylmälä
Tietojärjestelmäasiantuntija

Kansalliskirjasto
Kirjastoverkkopalvelut
PL 15 (Unioninkatu 36)
00014 Helsingin yliopisto


More information about the Koha-devel mailing list