Skip to content

protect global map access with read lock#127

Merged
diegoholiveira merged 1 commit intodiegoholiveira:mainfrom
reillywatson:main
Sep 16, 2025
Merged

protect global map access with read lock#127
diegoholiveira merged 1 commit intodiegoholiveira:mainfrom
reillywatson:main

Conversation

@reillywatson
Copy link
Copy Markdown
Contributor

If you call AddOperator() and either Apply() or IsValid() concurrently, the Go runtime can throw a fatal error about a concurrent map read+write. Similarly, tests that perform these operations concurrently will trigger race detector failures.

Make the operators lock into an RWMutex and hold a read lock when accessing the map to avoid this race.

If you call AddOperator() and either Apply() or IsValid() concurrently, the Go runtime can throw a fatal error about a concurrent map read+write. Similarly, tests that perform these operations concurrently will trigger race detector failures.

Make the operators lock into an RWMutex and hold a read lock when accessing the map to avoid this race.
@diegoholiveira diegoholiveira merged commit 8abd99c into diegoholiveira:main Sep 16, 2025
7 checks passed
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.

2 participants