Connector does not stop background refresh on close #493
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Bug Description
When callers close a dialer, it also closes all registered instances.
However, the instance close method doesn't stop the timers of the current and next refresh operations, leaving them running in the background and thereby leaking a goroutine.
In addition to stopping the refresh operation timers, we should check for a canceled context at the top of the
scheduleRefresh
function to ensure no run-away scheduling.Likewise ForceRefresh should be a no-op after the instance is closed to ensure the refresh loop doesn't restart.
Example code (or command)
No response
Stacktrace
No response
Steps to reproduce?
n/a
Environment
n/a
Additional Details
No response
The text was updated successfully, but these errors were encountered: