Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sqlliveness: session expiry callbacks must be async
Previously, the sqlliveness session expiry callbacks were called in the heartbeatLoop thread which executed the renew/expiry logic. This could cause deadlock since session expiration is used to trigger a shutdown of the SQL instance via `stopper.Stop()`. The stopper would wait for all async tasks to quiesce, but the `heartbeatLoop` would continue, waiting for the callbacks to finish running. In addition, this task would hold a lock on `l.mu` while waiting for the callbacks to run causing other threads to wait if they needed to retrieve the session. This change invokes each callback in its own goroutine to prevent this deadlock. Resolves cockroachdb#71292 Release note: None
- Loading branch information