Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: improve stack trace for get-user-timeout timeouts
Fixes #95794 The cause of the `get-user-timeout errors` is unknown. Part of the problem is that the stack trace gets cut off at ``` | | github.com/cockroachdb/cockroach/pkg/sql.retrieveSessionInitInfoWithCache | | github.com/cockroachdb/cockroach/pkg/sql/user.go:238 ``` which does not explain what is actually being blocked. The reason that the stack trace is cut off is that the timeout is initiated by `contextutil.RunWithTimeout` which results in a "simple" (no stack trace) `context.DeadlineExceeded` error. `retrieveSessionInitInfoWithCache` is the first line in the stack trace because it calls `errors.Wrap` on `context.DeadlineExceeded`. To get a fuller stack trace, `context.DeadlineExceeded` must be wrapped immediately (`errors.Wrap` or `errors.WithStack`) before it bubbles up. Release note: None
- Loading branch information