Skip to content

Commit de1da0a

Browse files
committed
Add some logging for canceled requests.
1 parent bcc459a commit de1da0a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

connection.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"database/sql"
1414
"database/sql/driver"
1515
"encoding/json"
16+
"fmt"
1617
"io"
1718
"net"
1819
"strconv"
@@ -104,6 +105,7 @@ func (mc *mysqlConn) Begin() (driver.Tx, error) {
104105
}
105106

106107
func (mc *mysqlConn) begin(readOnly bool) (driver.Tx, error) {
108+
errLog.Print(fmt.Sprintf("in mysqlConn.begin %s", readOnly))
107109
if mc.closed.IsSet() {
108110
errLog.Print(ErrInvalidConn)
109111
return nil, driver.ErrBadConn
@@ -433,6 +435,7 @@ func (mc *mysqlConn) getSystemVar(name string) ([]byte, error) {
433435
// finish is called when the query has canceled.
434436
func (mc *mysqlConn) cancel(err error) {
435437
mc.canceled.Set(err)
438+
errLog.Print(fmt.Sprintf("canceling a request and running mc.cleanup(): %s", err))
436439
mc.cleanup()
437440
}
438441

0 commit comments

Comments
 (0)