mirror of
https://github.com/siderolabs/talos.git
synced 2025-12-24 19:01:56 +01:00
The fix enforces the order `VolumeMountStatus` resources are locked via finalizers: the order follows the definition in the service, which follows the order parent -> child. Previous parallel implementation could put a finalizer on the child before parent, which might lead to a deadlock. Example flow: * there are two mount requests `/var/lib` and `/var/lib/audit` (having `/var/lib` as parent) * service requests mounts, puts finalizers, runs * service stops, releases volume mount requests, and restart * at the same time concurrently controller might decide to unmount `/var/lib` which will be blocked on child `/var/lib/audit` being mounted * starting service might put a finalizer on `/var/lib/audit` as it's not tearing down yet * the finalizer on a child `/var/lib/audit` will prevent `/var/lib` from being unmounted ever. Also remove mount requests generation hack. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com> (cherry picked from commit 536541afe497d5f61cfcd0c01cf580ab5b3be164)