Skip to content

Replace maps and bools with atomic primitives#685

Merged
gabriel-samfira merged 2 commits intocloudbase:mainfrom
gabriel-samfira:switch-to-sync-map
Mar 20, 2026
Merged

Replace maps and bools with atomic primitives#685
gabriel-samfira merged 2 commits intocloudbase:mainfrom
gabriel-samfira:switch-to-sync-map

Conversation

@gabriel-samfira
Copy link
Member

This change reduces the need for mutexes by replacing maps and bools used for state tracking with sync.Map and atomic.Bool.

Fixes: #684

This change switches from maps to sync.Map for various internal maps
we used to keep track of state. This spares us from having to guard
access to those maps using a mutex, hopefully eliminating potential
deadlocks.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Replace the "running" bool with atomic.Bool.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
@gabriel-samfira gabriel-samfira merged commit b959c7f into cloudbase:main Mar 20, 2026
4 checks passed
@gabriel-samfira gabriel-samfira deleted the switch-to-sync-map branch March 20, 2026 21:48
@benoit-nexthop
Copy link
Contributor

Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reentrancy Deadlock in Provider Worker

2 participants