-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bigquery/storage: ManagedStream leaks goroutines & channels #8272
Comments
Thanks for the report. The veneer library doesn't really interact at the grpc clientconn level, so more fundamental connection closing is not going to make sense. I'm refactoring context propagation as part of #8232 so that's going to be the best avenue for dealing with connection lifecycle. I'll take another look at that work in light of this report. |
Also, if you can share any more repro details that would be lovely. The 30 minute interval would suggest to me that you're dealing with idle connection recycling (a connection idle for ~10 minute will be closed on the server side), but it's not clear from the existing details. |
Client
BigQuery/Storage
Environment
Any
Go Environment
Any
Code
This is related to the memory leak issue that was fixed in v1.43
#6766
We have long running consumers that use 3 managed streams and receive a large batch of messages every 30 minutes.
We noticed a memory leak and I was able to trace the leak of gorutines to
managedwriter.connRecvProcessor
andgrpc.newClientStreamWithParams
functions creating 3 additional goroutines every time a new batch of messages is produced.After updating to v1.52
managedwriter.connRecvProcessor
stoped leaking but we still seegrpc.newClientStreamWithParams
creating 3 new goroutines every 30 minutes.The fix used
arc.CloseSend
but the grpc package says this - note at point 3:Expected behavior
Previous connections are closed.
Actual behavior
Previous connections are not closed and goroutines are leaked.
Screenshots
Gorutines in v1.42
Gorutines in v1.52
The text was updated successfully, but these errors were encountered: