Commit 8d7b28f
authored
Spanner: fix possible thread leak in Spanner.close() (#5060)
Spanner.close() did not cleanup all threads in use
A Spanner instance holds a reference to three underlying gRPC stubs:
spannerStub, instanceAdminStub and databaseAdminStub. These should all
have their own thread pool for gRPC calls. This was achieved by setting
an executor provider on the channel provider for the stubs. The worker
threads of the thread pools created by this executor provider were
however not shutdown when the stubs were closed, causing thread leaks if
an application would open and close multiple Spanner instances during
its lifetime.1 parent 32551b2 commit 8d7b28f
3 files changed
Lines changed: 1780 additions & 3 deletions
File tree
- google-cloud-clients/google-cloud-spanner/src
- main/java/com/google/cloud/spanner/spi/v1
- test/java/com/google/cloud/spanner
- spi/v1
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
118 | | - | |
119 | 117 | | |
120 | 118 | | |
121 | 119 | | |
| |||
190 | 188 | | |
191 | 189 | | |
192 | 190 | | |
193 | | - | |
194 | 191 | | |
195 | 192 | | |
196 | 193 | | |
| |||
582 | 579 | | |
583 | 580 | | |
584 | 581 | | |
| 582 | + | |
585 | 583 | | |
586 | 584 | | |
587 | 585 | | |
| |||
0 commit comments