Fix loop var reference issue in pathmgr
The loop variable, `request`, is re-used, which means that referencing
it later from a closure will not yield the expected value.
@@ -68,8 +68,10 @@ func (r *resolver) run() {
} else {
wait = r.normalRefire
}
+ // Make a copy of loop var for closure.
+ req := request
time.AfterFunc(wait, func() {
- r.requestQueue <- request
+ r.requestQueue <- req
})
}
default:
