Goroutine leak in transaction retry #15050
Labels
priority/P2
The issue has P2 priority.
severity/moderate
sig/transaction
SIG:Transaction
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
Connection 1:
Connection 2 (cause connection 1 to write conflict):
Connection 1 (continue the transaction):
What did you expect to see?
Check http://127.0.0.1:10080/debug/pprof/goroutine?debug=1 and see no goroutine leak.
What did you see instead?
Check http://127.0.0.1:10080/debug/pprof/goroutine?debug=1 and see goroutine leak.
What version of TiDB are you using (
tidb-server -V
or runselect tidb_version();
on TiDB)?v3.0.7, master, etc.
Reason
The reason is that
(select * from test) union (select * from test)
is not treated as read-only statement, so it's executed again when retrying the transaction. But the result set is never closed because the statement is not expected to produce results.The text was updated successfully, but these errors were encountered: