mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-05-22 18:51:21 +00:00
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:
parent
8e64c564fe
commit
eb3e7fe95f
2
query.go
2
query.go
@ -209,6 +209,8 @@ func (r *dhtQueryRunner) spawnWorkers(proc process.Process) {
|
|||||||
select {
|
select {
|
||||||
case p, more := <-r.peersToQuery.DeqChan:
|
case p, more := <-r.peersToQuery.DeqChan:
|
||||||
if !more {
|
if !more {
|
||||||
|
// Put this back so we can finish any outstanding queries.
|
||||||
|
r.rateLimit <- struct{}{}
|
||||||
return // channel closed.
|
return // channel closed.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user