You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sql: fix a few edge case bugs with CHECK EXTERNAL CONNECTION
This commit fixes a few edge case bugs with CHECK EXTERNAL CONNECTION
implementation. Namely:
- previously, the execution goroutine (that is created in `startExec`)
would use the tracing span that is finished, which is not allowed. This
is now fixed by deriving a new tracing span.
- also previously we would call `MoveToDraining` from an auxiliary
goroutine of the cloud check processor when the context cancellation is
observed. This would race with `MoveToDraining` call from the main
goroutine in `Next`. The implicit contract of this helper method is that
it's only called from the main goroutine, and otherwise it can lead to
"MoveToDraining called in state × with err" errors. This is now fixed by
removing the call from the auxiliary goroutine since it's actually not
needed.
- previously, we could've created a channel with no buffer when
concurrency parameter was unspecified. In an edge case this could lead
to a deadlock.
- also if the query is canceled before the execution goroutine is
started, it could lead to "use of Span after Finish" error.
Additionally, this commit simplifies dealing with the `rows` channel
a bit.
I decided to omit the release note given we recently merged a fix that
contained one.
Release note: None
0 commit comments