|
|
|
|
|
by Omie6541
4145 days ago
|
|
Please correct me if I have got this wrong or missed some code piece but you are pushing log records to a buffered channel (incomingChannel) without making sure that it has some space left. When that buffer of 2048 gets full, all the next requests are going to get blocked. Even if you call .log() in the background, there will be number of goroutines waiting to get their turn which will lead the system to a state where you have no idea what is pending and where. here's a smaller version of the problem, notice how fillFoo() will have to wait to push to the buffer.
https://gist.github.com/Omie/52add99f6685dcb340a1 there's also a similar problem (how they solved it) described here: http://pivotallabs.com/a-concurrent-ring-buffer-for-go/ |
|