Skip to content

Commit

Permalink
Merge pull request cockroachdb#47701 from knz/backport20.1-47700
Browse files Browse the repository at this point in the history
  • Loading branch information
knz authored Apr 20, 2020
2 parents 56b3d25 + 0346b7d commit 0315d68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/sql/pgwire/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ func (c *conn) serveImpl(
authOpt authOptions,
stopper *stop.Stopper,
) {
defer func() { _ = c.conn.Close() }()

ctx = logtags.AddTag(ctx, "user", c.sessionArgs.User)

inTestWithoutSQL := sqlServer == nil
Expand All @@ -220,7 +222,6 @@ func (c *conn) serveImpl(
authLogger = sqlServer.GetExecutorConfig().AuthLogger
sessionStart := timeutil.Now()
defer func() {
_ = c.conn.Close()
if c.authLogEnabled() {
authLogger.Logf(ctx, "session terminated; duration: %s", timeutil.Now().Sub(sessionStart))
}
Expand Down

0 comments on commit 0315d68

Please sign in to comment.