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

sql: fix a race in the internal executor #60425

Merged
merged 1 commit into from
Feb 10, 2021
Merged

Conversation

yuzefovich
Copy link
Member

The recent change to make the internal executor streaming introduced
a race between initConnEx returning (and, thus, assigning a stmtBuf
value) and the connExecutor's goroutine being spawn up. As a result, the
assumption of the callbacks that the stmtBuf is non-nil might not be
satisfied. This commit fixes the issue by creating the objects in
question before initConnEx is called (which is also before the
connExecutor goroutine starts).

Fixes: #60423.

Release note: None

The recent change to make the internal executor streaming introduced
a race between `initConnEx` returning (and, thus, assigning a stmtBuf
value) and the connExecutor's goroutine being spawn up. As a result, the
assumption of the callbacks that the stmtBuf is non-nil might not be
satisfied. This commit fixes the issue by creating the objects in
question before `initConnEx` is called (which is also before the
connExecutor goroutine starts).

Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich
Copy link
Member Author

TFTR!

bors r+ p=9999 single on

@craig
Copy link
Contributor

craig bot commented Feb 10, 2021

Build succeeded:

@craig craig bot merged commit ffcd641 into cockroachdb:master Feb 10, 2021
@yuzefovich yuzefovich deleted the ie-fix branch February 10, 2021 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: Close() called on nil StmtBuf
3 participants