Skip to content

Instantly share code, notes, and snippets.

@dasl-
Created October 7, 2019 20:41
Show Gist options
  • Save dasl-/09b9e62eb4fc327afffc949a3a1ef630 to your computer and use it in GitHub Desktop.
Save dasl-/09b9e62eb4fc327afffc949a3a1ef630 to your computer and use it in GitHub Desktop.
diff --git a/go/pools/resource_pool.go b/go/pools/resource_pool.go
index 945393c79..204ac64d9 100644
--- a/go/pools/resource_pool.go
+++ b/go/pools/resource_pool.go
@@ -23,6 +23,7 @@ import (
"fmt"
"sync"
"time"
+ "vitess.io/vitess/go/vt/log"
"golang.org/x/net/context"
@@ -195,6 +196,8 @@ func (rp *ResourcePool) Get(ctx context.Context) (resource Resource, err error)
}
func (rp *ResourcePool) get(ctx context.Context) (resource Resource, err error) {
+ d, _ := ctx.Deadline()
+ log.Infof("dasl tx pool.get time until deadline: %v", time.Until(d))
// If ctx has already expired, avoid racing with rp's resource channel.
select {
case <-ctx.Done():
diff --git a/go/vt/vttablet/tabletserver/connpool/dbconn.go b/go/vt/vttablet/tabletserver/connpool/dbconn.go
index f505dff7d..91dce5841 100644
--- a/go/vt/vttablet/tabletserver/connpool/dbconn.go
+++ b/go/vt/vttablet/tabletserver/connpool/dbconn.go
@@ -130,6 +130,8 @@ func (dbc *DBConn) Exec(ctx context.Context, query string, maxrows int, wantfiel
}
func (dbc *DBConn) execOnce(ctx context.Context, query string, maxrows int, wantfields bool) (*sqltypes.Result, error) {
+ d, _ := ctx.Deadline()
+ log.Infof("dasl execOnce time left to deadline: %v", time.Until(d))
dbc.current.Set(query)
defer dbc.current.Set("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment