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
When fixing #20622 it was necessary to instrument the fakeDB in such a way so race conditions on the driver would become apparent. After fixing that issue and running the trybots, TestConcurrency/TxStmtQuery began failing. This was because this test starts a transaction and then creates a Stmt on the Tx. It then calls stmt.Query in parallel. This results in a potential race condition on the Tx driver connection.
One possible fix is to hold the Stmt.closemu exclusively during queries if Stmt.tx is not null.
The other "fix" is to remove this test case and declare Stmts that derive from Tx should still be called in a single threaded manner.
The text was updated successfully, but these errors were encountered:
In addition to adding a guard to the Rows close, add a var
in the fakeConn that gets read and written to on each
operation, simulating writing or reading from the server.
TestConcurrency/TxStmt* tests have been commented out
as they now fail after checking for races on the fakeConn.
See issue #20646 for more information.
Fixes#20622
Change-Id: I80b36ea33d776e5b4968be1683ff8c61728ee1ea
Reviewed-on: https://go-review.googlesource.com/45275
Run-TryBot: Daniel Theophanes <kardianos@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
When fixing #20622 it was necessary to instrument the fakeDB in such a way so race conditions on the driver would become apparent. After fixing that issue and running the trybots, TestConcurrency/TxStmtQuery began failing. This was because this test starts a transaction and then creates a Stmt on the Tx. It then calls stmt.Query in parallel. This results in a potential race condition on the Tx driver connection.
One possible fix is to hold the Stmt.closemu exclusively during queries if Stmt.tx is not null.
The other "fix" is to remove this test case and declare Stmts that derive from Tx should still be called in a single threaded manner.
The text was updated successfully, but these errors were encountered: