GoogleCloudPlatform / GoogleCloudPlatform/cloud-spanner-r2dbc
Find and close all `SpannerClientLibraryConnectionFactory` on Spring Data context shutdown
Open
enhancement
P2
V2
- Dominant language
- Java
- Stars
- 60
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
1) Pending outcome of spring-projects/spring-framework#26991, add a listener for `ContextClosedEvent` to find `SpannerClientLibraryConnectionFactory` beans and call `Closeable.close().subscribe()`. Might have to even block to avoid race conditions ("app shut down before sessions are released")
2) Add stronger documentation warnings about having to close custom created Spanner connection factories on context shutdown (to avoid server-side session leaks, as the client library pre-allocates ~200 sessions).
Contributor guide
Assessment
This issue has not been assessed yet.