Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connector does not stop background refresh on close #493

Closed
enocom opened this issue Jan 23, 2024 · 0 comments · Fixed by #496
Closed

Connector does not stop background refresh on close #493

enocom opened this issue Jan 23, 2024 · 0 comments · Fixed by #496
Assignees
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.

Comments

@enocom
Copy link
Member

enocom commented Jan 23, 2024

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

@enocom enocom added 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. labels Jan 23, 2024
@enocom enocom assigned enocom and unassigned jackwotherspoon Jan 23, 2024
enocom pushed a commit to jomaresch/alloydb-go-connector that referenced this issue Jan 24, 2024
enocom pushed a commit to jomaresch/alloydb-go-connector that referenced this issue Jan 24, 2024
enocom pushed a commit to jomaresch/alloydb-go-connector that referenced this issue Jan 24, 2024
enocom pushed a commit to jomaresch/alloydb-go-connector that referenced this issue Jan 24, 2024
enocom pushed a commit to jomaresch/alloydb-go-connector that referenced this issue Jan 24, 2024
enocom pushed a commit to jomaresch/alloydb-go-connector that referenced this issue Jan 24, 2024
@enocom enocom closed this as completed in 42c8ae3 Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants