Skip to content

Call TraceQueryEnd during Exec errors#2590

Merged
jackc merged 1 commit into
jackc:masterfrom
cbandy:trace-exec-err
Jun 30, 2026
Merged

Call TraceQueryEnd during Exec errors#2590
jackc merged 1 commit into
jackc:masterfrom
cbandy:trace-exec-err

Conversation

@cbandy

@cbandy cbandy commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

We should make every effort to call TraceQueryEnd after calling TraceQueryStart. Conn.Query handles this case but not Conn.Exec:

pgx/conn.go

Lines 756 to 761 in 7fd58a7

if err := c.deallocateInvalidatedCachedStatements(ctx); err != nil {
if c.queryTracer != nil {
c.queryTracer.TraceQueryEnd(ctx, c, TraceQueryEndData{Err: err})
}
return &baseRows{err: err, closed: true}, err
}

We should make every effort to call `TraceQueryEnd` after calling
`TraceQueryStart`.
@jackc jackc merged commit 00b606d into jackc:master Jun 30, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants