Commit 04caeac
committed
Avoid closing connections twice when driver is closed
When closed, driver purges all connections from the connection pool
and then closes all connections stored in an internal array of all
alive connections. First step is needed to close all connections
that are idle in the connection pool. Second step is needed to close
all connections that are active and checked out of the connection pool.
Note that list of all connections contains both idle and active
connections.
Driver used to purge the pool at the same time as going over the list
of all connections. This made it close some idle connections twice.
It did not cause any issues but resulted in a bit weird logging where
`Connection.close()` operation was logged twice.
This commit fixes the problem by making driver first purge the pool and
then go over the list of all connections to close them.1 parent 46c36ff commit 04caeac
1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
| 241 | + | |
| 242 | + | |
245 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
246 | 252 | | |
247 | 253 | | |
248 | 254 | | |
| |||
0 commit comments