Commit 9c29290
Fix PostgreSQL connection leak on failed establishment
If post-connect setup (PGConnection unwrap / addDataType registration) throws,
close the freshly-opened physical connection before propagating, otherwise the
server-side backend leaks - the caller only ever sees the exception and never
gets a handle to close. Mirrors the native adapter discarding a connection
that could not be fully established.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 4c2d48e commit 9c29290
1 file changed
Lines changed: 27 additions & 11 deletions
Lines changed: 27 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | | - | |
246 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
247 | 263 | | |
248 | | - | |
249 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
250 | 272 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | 273 | | |
258 | 274 | | |
259 | 275 | | |
| |||
0 commit comments