[Ovmsdev] Deadlock on module reset
Michael Balzer
dexter at expeedo.de
Mon Apr 13 17:31:57 HKT 2020
Chris informed me my commit bfcb1be97bb8fbfda9913f9094ba71ef9c94c7e8 introduced a deadlock in the module shutdown.
My tests showed it doesn't always occur. A first simple analysis of the locks set during shutdown shows there is a race between networking tasks reacting to the
"system.shuttingdown" event and the events task processing the next ticker event. It seems the subsystems which registered for processing events try to
deregister while still allowing to process the next event delivered, leading to the deadlock.
I think fixing this needs a thorough rework of the shutdown deregistration processes. As the event mutex was meant to fix a potential race condition, I've
reverted the change for now.
Regards,
Michael
--
Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
More information about the OvmsDev
mailing list