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 another minor bug with CHECK EXTERNAL CONNECTION
Previously, we could create a channel with no buffer if concurrency
parameter wasn't specified. As a result, in an edge case (that was
exposed by recently added test) the reader goroutine might have exited
_before_ reading from the unbuffered channel which would result in
a deadlock (because the writer goroutine would block on sending into the
channel, and the reader - i.e. the main goroutine - would block waiting
on the wait group). This is now fixed by unifying the logic for
determining the concurrency.
We could've made sending on `n.rows` channel also check the context
cancellation if we're being conservative, but that seems like an
overkill.
Additionally, it fixes an extreme edge case where we could hit "use of
Span after Finish" issue in case when the context canceled (because of
small statement timeout) before the execution worker goroutine was
started. This is addressed by blocking the main goroutine until the
worker goroutine is spun off.
Release note: None
0 commit comments