[GH-ISSUE #5] Unsafe Map Operations Causing Panic #6

Closed
opened 2026-02-26 10:34:27 +03:00 by kerem · 1 comment
Owner

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.

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.
kerem closed this issue 2026-02-26 10:34:27 +03:00
Author
Owner

@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.

<!-- gh-comment-id:388560675 --> @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.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lottip#6
No description provided.