Commit eb3e7fe9 authored by Steven Allen's avatar Steven Allen

fix a potential DHT query hang

Without this, one of the workers may hang when trying to re-grab the rate-limit
after dialing. I believe this may be what's causing some of our DHT requests to
stall (evidence: massive goroutine buildup on the gateways).
parent 8e64c564
......@@ -209,6 +209,8 @@ func (r *dhtQueryRunner) spawnWorkers(proc process.Process) {
select {
case p, more := <-r.peersToQuery.DeqChan:
if !more {
// Put this back so we can finish any outstanding queries.
r.rateLimit <- struct{}{}
return // channel closed.
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment