Skip to content

nrpgx5 transaction issue during segment close #976

Open
@akushsky

Description

@akushsky

I'm trying to switch legacy nrpgx-based project to nrpgx5.
I have a lot of requests (all my SELECT ones) that are not wrapped to transactions.
Previously it was working perfectly, but now it occurs an error log on each segment close.
It doesn't affect real NewRelic data, I could see all graphs etc., but it's flooding to my log output.

What I'm doing wrong? It's a must to wrap each request (even if it's a SELECT) to transaction?

Unable to end datastore segment - product: Postgres collection: table_name operation: select reason: transaction has already ended [init]

newrelic.(*DatastoreSegment).End (segments.go:206) github.com/newrelic/go-agent/v3/newrelic
nrpgx5.(*Tracer).TraceQueryEnd (nrpgx5.go:170) github.com/newrelic/go-agent/v3/integrations/nrpgx5
pgx.(*baseRows).Close (rows.go:188) github.com/jackc/pgx/v5
stdlib.(*Rows).Close (sql.go:693) github.com/jackc/pgx/v5/stdlib
sql.(*Rows).close.func1 (sql.go:3450) database/sql
sql.withLock (sql.go:3566) database/sql
sql.(*Rows).close (sql.go:3449) database/sql
sql.(*Rows).Close (sql.go:3433) database/sql
........
runtime.main (proc.go:272) runtime
runtime.goexit (asm_arm64.s:1223) runtime
 - Async Stack Trace
<autogenerated>:2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions