-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reconnect after all idle connections close (#290)
* chore(benchmarks): run go mod tidy * chore(examples): run gofmt * fix: reconnect after all idle connections close When all connnections attached to the connector closed then the spanner client and admin client was closed. This is a problem, because the database may still hold on to the connector and may want to make new connections. This changes the logic such that the connector can reconnect the client when necessary. Fixes #288 * test: add tests for both zero and non-zero MinIdleConns * fix: implement Closer in connector Implement the Closer interface for connector and use that to remove it from the list of active connectors. Closing all idle connections of a connector will close the underlying clients, but allow these to be re-initialized if the connector is used again. Re-using a connector that has been closed is not possible. --------- Co-authored-by: Knut Olav Løite <[email protected]>
- Loading branch information
Showing
4 changed files
with
201 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters