Skip to content

Commit

Permalink
sql: fix race in execStmtInOpenState
Browse files Browse the repository at this point in the history
Fixes #53573

Release justification: low-risk update to new functionality

Release note: None
  • Loading branch information
solongordon committed Aug 31, 2020
1 parent cccfea3 commit d777d88
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pkg/sql/conn_executor_exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,10 @@ func (ex *connExecutor) execStmtInOpenState(
ex.incrementExecutedStmtCounter(stmt)
}
}()

ex.state.mu.Lock()
ex.state.mu.stmtCount++
ex.state.mu.Unlock()

os := ex.machine.CurState().(stateOpen)

Expand Down
2 changes: 0 additions & 2 deletions pkg/sql/run_control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockroach/pkg/util/log"
Expand Down Expand Up @@ -300,7 +299,6 @@ GRANT admin TO has_admin2;

func TestCancelQueryPermissions(t *testing.T) {
defer leaktest.AfterTest(t)()
skip.WithIssue(t, 53584, "flaky test")
defer log.Scope(t).Close(t)

// getQueryIDs retrieves the IDs of any currently running queries for the
Expand Down

0 comments on commit d777d88

Please sign in to comment.