Skip to content

Snapshot lock IDs before awaiting in all-lock refresh loops #705

Description

@tykeal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions