GoogleCloudPlatform / GoogleCloudPlatform/cloud-sql-jdbc-socket-factory
Recover gracefully from laptop sleep
- Dominant language
- Java
- Stars
- 255
- Forks
- 117
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 4
Description
Right now if a laptop goes to sleep with an active connection to a Cloud SQL instance, the socket factory won't recover on its own once the laptop has been restored.
There are limitations in Java to handling this:
https://stackoverflow.com/questions/52876556/how-does-java-calculate-sleep-time-when-pc-goes-into-hibernate-mode
Nonetheless, we should throw out a bad connection and force a refresh, such that the socket factory recovers gracefully from sleep.
See https://github.com/luryus/cloud-sql-jdbc-hang for a reproduction of this issue.
Related to https://github.com/GoogleCloudPlatform/cloud-sql-proxy/issues/1788.
Whatever we do here, we should port to the AlloyDB Java Connector as well.
Contributor guide
Assessment
This issue has not been assessed yet.