-
Notifications
You must be signed in to change notification settings - Fork 573
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
When should I call Close on connection? #1347
Comments
Error is coming for me in |
The answer is no to all of these. Until you really want to close the connection pool.
Connections are automatically released to the pool after use.
Can be caused by any network glitch. Depending on your use case, your application should be able to retry. If you observe it intensifies for long living connections, you can decrease your |
its running on AWS fargate, so I am network isn't an issue. After calling close after each operation it works. I also added a sleep timeout of 100 milliseconds between each clickhouse query call. There are 10k read query ops to table A. post that I filter the result and call conn.PrepareBatch to push data into table B. any way to get more error details out of the library? |
General rule for distributed systems is network is unreliable.
Would be great if you share a code snippet. I am not sure about how Fargate implements network, but maybe there are some settings that might cause a socket drop. What is the time delay between connection reuse? |
I am setting up the connection as
If I do not call close and keep using the conn object. I get this error after sometime
Do I need to call conn.Close() after conn.Exec ?
Do I need to call conn.Close() after conn.Select ?
Do I need to call conn.Close() after conn.QueryRow().ScanStruct() ?
Do I need to call conn.Close() after batch.Send ?
Or how do I return the connection to the pool?
The text was updated successfully, but these errors were encountered: