Skip to content

flannel: protect knownSubnets map with mutex to fix data race - #6

Merged
phaus merged 1 commit into
mainfrom
fix/flannel-knownsubnets-race
Sep 4, 2026
Merged

flannel: protect knownSubnets map with mutex to fix data race#6
phaus merged 1 commit into
mainfrom
fix/flannel-knownsubnets-race

Conversation

@phaus

@phaus phaus commented Sep 4, 2026

Copy link
Copy Markdown
Member

The package-level knownSubnets map is read and written in WatchSubnets without synchronization. Multiple goroutines calling WatchSubnets concurrently would race on this Go map, causing undefined behavior.

Add a sync.Mutex to serialize access to the map.

The package-level knownSubnets map is read and written in WatchSubnets
without synchronization. Multiple goroutines calling WatchSubnets
concurrently would race on this Go map, causing undefined behavior.

Add a sync.Mutex to serialize access to the map.
@phaus
phaus merged commit ee350ca into main Sep 4, 2026
2 checks passed
@phaus
phaus deleted the fix/flannel-knownsubnets-race branch September 4, 2026 09:04
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.

1 participant