-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 race in execStmtInOpenState #53574
Conversation
Fixes cockroachdb#53573 Release justification: low-risk update to new functionality Release note: None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
@@ -244,7 +244,10 @@ func (ex *connExecutor) execStmtInOpenState( | |||
ex.incrementExecutedStmtCounter(stmt) | |||
} | |||
}() | |||
|
|||
ex.state.mu.Lock() | |||
ex.state.mu.stmtCount++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's worth using atomic increments and loads for this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I suppose that would be better, but I think lock contention will be quite rare here so I'm going to go ahead and merge as-is for now since this is affecting multiple tests.
bors r+ |
This PR was included in a batch that was canceled, it will be automatically retried |
Build succeeded: |
Fixes #53573
Release justification: low-risk update to new functionality
Release note: None