Bug #22645
closedA deadlock can occur at boot (also a cause of slow initialization)
Description
Sometimes, we see a deadlock around boot time in rudder.
it seems to be more frequent with 7.3 (and so likely b/c of switch to zio 2).
Perhaps a reproduce is that it boil down to a much more maze like instance of an early init problem as minimized here : https://github.com/zio/zio/issues/8044
Since RudderConfig is growing very complicated and zio2 seems to be more agressive in creation of instance needed a lock, it is likely to be that.
The correct, principle solution to that problem is to a principle depency injection framework like zio layers. But it won't be even remotely compatible with what we have.
We could also come back to the "lazy val everywhere" solution that we used to use in early version of rudder but abandoned because it created surprises with late init of services (like batch not started or service init error lurking undetected before a very long time).
Plus, we have to keep the current existing RudderConfig API which is used pervasively in Rudder.
So, the solution is to split cleanly appart RudderConfig init from the init of other services/etc.
So RudderConfig needs to just assign all its public fields in one go by calling a method which does all the current init logic and returns all the initialized services in a data container class.
I'm not sure it's possible or if it will just add a level of turtles.
Updated by François ARMAND over 1 year ago
- Category set to Architecture - Internal libs
- Assignee set to François ARMAND
- Target version set to 7.3.1
- Severity set to Major - prevents use of part of Rudder | no simple workaround
- UX impact set to I hate Rudder for that
- User visibility set to Operational - other Techniques | Rudder settings | Plugins
- Effort required set to Medium
- Priority changed from 0 to 83
Updated by François ARMAND over 1 year ago
- Status changed from New to In progress
Updated by François ARMAND over 1 year ago
- Status changed from In progress to Pending technical review
- Assignee changed from François ARMAND to Alexis Mousset
- Pull Request set to https://github.com/Normation/rudder/pull/4760
Updated by Anonymous over 1 year ago
- Status changed from Pending technical review to Pending release
Applied in changeset rudder|65b2b6b13caf0ee1a7eebab69172d6159bbfd257.
Updated by François ARMAND over 1 year ago
- Status changed from Pending release to In progress
This is not merged yet
Updated by Anonymous over 1 year ago
- Status changed from In progress to Pending release
Applied in changeset rudder|81afcd7441f13a293144c3b7a01504c8de3126f4.
Updated by Vincent MEMBRÉ over 1 year ago
- Subject changed from Deadlock in rudder 7.3 (and perhaps 7.2) to A deadlock can occur at boot (also a cause of slow initialization)
Updated by Vincent MEMBRÉ over 1 year ago
- Fix check changed from To do to Checked
Updated by Vincent MEMBRÉ over 1 year ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 7.3.1 which was released today.