Unverified Commit d9c9ee5a authored by Péter Szilágyi's avatar Péter Szilágyi Committed by GitHub

Merge pull request #22753 from karalabe/p2p-tracker-stopfix

p2p/tracker: only reschedule wake if previous didn't run
parents 55043eec ff3535e8
...@@ -188,9 +188,10 @@ func (t *Tracker) Fulfil(peer string, version uint, code uint64, id uint64) { ...@@ -188,9 +188,10 @@ func (t *Tracker) Fulfil(peer string, version uint, code uint64, id uint64) {
t.expire.Remove(req.expire) t.expire.Remove(req.expire)
delete(t.pending, id) delete(t.pending, id)
if req.expire.Prev() == nil { if req.expire.Prev() == nil {
t.wake.Stop() if t.wake.Stop() {
t.schedule() t.schedule()
} }
}
g := fmt.Sprintf("%s/%s/%d/%#02x", trackedGaugeName, t.protocol, req.version, req.reqCode) g := fmt.Sprintf("%s/%s/%d/%#02x", trackedGaugeName, t.protocol, req.version, req.reqCode)
metrics.GetOrRegisterGauge(g, nil).Dec(1) metrics.GetOrRegisterGauge(g, nil).Dec(1)
......
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