KeymasterCoordinator.async_refresh_all_locks() iterates self.kmlocks directly in loops that await inside the body. If a config entry is added or removed while one of those awaits is suspended, Python can raise RuntimeError: dictionary changed size during iteration.
This is pre-existing and was observed while reviewing draft PR #695; the same direct-iteration pattern exists on the current base. A targeted fix would snapshot the keys before entering the awaited loops, then skip entries that no longer exist when each iteration resumes.
KeymasterCoordinator.async_refresh_all_locks()iteratesself.kmlocksdirectly in loops thatawaitinside the body. If a config entry is added or removed while one of those awaits is suspended, Python can raiseRuntimeError: dictionary changed size during iteration.This is pre-existing and was observed while reviewing draft PR #695; the same direct-iteration pattern exists on the current base. A targeted fix would snapshot the keys before entering the awaited loops, then skip entries that no longer exist when each iteration resumes.