Open victor-ferrer-form3 opened 5 months ago
Note: Reverting to v5.5.2
solves the issue.
Please provide more details. I don't think this happens for every query/use case. For example, I can't replicate it using pgx in database/sql
mode (tested both Postgres and CockroachDB).
Probably a Unwatch
call is missing in some edge case in the code changed between 5.5.2 and 5.5.5
Hello @drakkan!
One thing that we have noticed is that the only service in which we see this behavior is one that uses Batch statements. We have noticed this commit, introduced as part of the release 5.5.4 that has several changes related to Batches, although I am not sure if this causes the issue.
To try to narrow the problem down, we are going to repeat our tests with pgx v.5.5.3
and let you know of the results.
Update: pgx v.5.5.3 does not have this problem.
@victor-ferrer-form3 : have you tried with pgx v5.5.4, or had any success bisecting the problem?
Hi @sean-, Yes v.5.5.4 has the problem too. For the moment our only solution was to downgrade to v.5.5.3 and add exceptions for the security vulnerabilities it has.
Hello @drakkan, do you have any update or ETA on the fix for this? Thanks
Hello @drakkan, do you have any update or ETA on the fix for this? Thanks
I'm not working on this, sorry. I don't use Batch
statements and so I'm unable to replicate the issue in my use case
Describe the bug
Recently we upgraded our software to pgx v5.5.5 and inmediately noticed that the number of Go routines our pods use is ever increasing. This is a screenshot of our monitoring tool, depicting the
go_goroutines
metric:The point where it starts to crawl up, matches our update to
v5.5.2
tov5.5.5
.If we enable Pprof after the pod has spent some hours running we can see this:
To Reproduce Steps to reproduce the behavior:
If possible, please provide runnable example such as:
Please run your example with the race detector enabled. For example,
go run -race main.go
orgo test -race
.Expected behavior We would expect those watches to be cancelled/closed and the Go Routines ended.
Actual behavior Context watchers seem not to be finished properly.
Version
$ go version
-> 1.225.5.5