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).
This commit is contained in:
Steven Allen 2018-12-26 22:29:25 -08:00
parent 8e64c564fe
commit eb3e7fe95f

View File

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