Skip to content
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

database/sql: change default SQL connection lifetime to shorter value #34777

Closed
mcandre opened this issue Oct 8, 2019 · 2 comments
Closed

database/sql: change default SQL connection lifetime to shorter value #34777

mcandre opened this issue Oct 8, 2019 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mcandre
Copy link

mcandre commented Oct 8, 2019

The default SQL connection lifetime appears to be zero value, with the result that connections often break from (My)SQL server side default configurations of 8 hours.

Can Go change the default connection lifetime to a lesser value, such as 6 hours or 4 hours, in order to integrate better with typical SQL servers with regular batch, idle query patterns?

https://golang.org/src/database/sql/sql.go

@ianlancetaylor ianlancetaylor changed the title Better default SQL connection lifetime database/sql: better default SQL connection lifetime Oct 9, 2019
@ianlancetaylor
Copy link
Contributor

CC @kardianos

@andybons andybons changed the title database/sql: better default SQL connection lifetime database/sql: change default SQL connection lifetime to shorter value Oct 10, 2019
@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 10, 2019
@andybons andybons added this to the Unplanned milestone Oct 10, 2019
@kardianos
Copy link
Contributor

No.

Having any connection lifetime to me is... questionable at best. If you need a shorter lifetime, please set the DB pool options.

@golang golang locked and limited conversation to collaborators Jan 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants