mirror of
https://github.com/orderbynull/lottip.git
synced 2026-04-25 06:45:49 +03:00
[GH-ISSUE #5] Unsafe Map Operations Causing Panic #6
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lottip#6
Loading…
Add table
Add a link
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?
Originally created by @bradleypeabody on GitHub (May 12, 2018).
Original GitHub issue: https://github.com/orderbynull/lottip/issues/5
In proxy.go you're doing all kinds of unsafe map operations. The program panics almost immediately when I try to run under any load. Please have a look at https://golang.org/doc/faq#atomic_maps . If I have a chance to put in PR with a fix I will, but haven't had time just yet. One common approach would be to add a sync.Mutex (or sync.RWMutex) and use that around map access calls.
@orderbynull commented on GitHub (May 12, 2018):
Hello, thanks for your report. You're totally right. I've tested lottip with a lot of queries per sec but all within few connections so i missed concurrent map writes. I'll test and accept your PR. Thanks again.