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 race in execStmtInOpenState #53574

Merged
merged 1 commit into from
Sep 1, 2020
Merged

Conversation

solongordon
Copy link
Contributor

Fixes #53573

Release justification: low-risk update to new functionality

Release note: None

@solongordon solongordon requested review from jordanlewis and a team August 27, 2020 21:11
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Fixes cockroachdb#53573

Release justification: low-risk update to new functionality

Release note: None
Copy link
Member

@jordanlewis jordanlewis left a 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++
Copy link
Contributor

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

Copy link
Contributor Author

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.

@solongordon
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 31, 2020

This PR was included in a batch that was canceled, it will be automatically retried

@craig
Copy link
Contributor

craig bot commented Sep 1, 2020

Build succeeded:

@craig craig bot merged commit f2056ba into cockroachdb:master Sep 1, 2020
@solongordon solongordon deleted the fix-race branch September 14, 2020 12:00
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: race in TestCancelQueryPermissions
4 participants