pool: Sampler isn't protected by mutex #221
Labels
No labels
P0
P1
P2
P3
good first issue
pool
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-sdk-go#221
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Expected Behavior
Sampler is thread safe.
Current Behavior
Sometimes we get panic:
Possible Solution
Since random generator isn't thread safe but we invoke it from multiple goroutines we must protect it with mutex .
Steps to Reproduce (for bugs)
Run the following test several times:
Regression
Yes
Your Environment
https://pkg.go.dev/golang.org/x/exp/rand has locked source, should be enough (though we can write our own wrapper too, not a rocket science).
Refs #125
dkirillov referenced this issue2024-05-08 11:56:01 +00:00