Autostarting code causing deadlocks during Litium startup

Hi,

I have an “interesting” issue in a project during startup.

We get database timeouts, probably caused by deadlocks. With trial and error and Litium support it has been narrowed down to classes using [Autostart] and IAsyncAutostart that have a lot of dependencies in ctor. The purpose of these classes is registering event listeners using EventBroker. There is however a lot of services needed to handle the events in some cases. One of these maybe take in 15+ services (order, baseproduct, variant, keylookup, shipment, payment etc etc)

I don’t know if it’s the amount of autostarting classes in combination or if its just one of them that has a long list of dependencies in the wrong order or something.

I have a workaround that is not recommended, so the question is how do I stop the deadlocks?

Litium version: 8

FYI: The problem was almost fully resolved by lowering the amount of read operations from Redis/Database (SettingService, Keylookupservice etc) in the IAsyncAutostarting jobs and other code that starts up with Litium.

A lot of initial reads was moved so that they happen at first usage instead, which delays it/lowers the pressure during start up.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.