Commit d8530e8
committed
Prevent connection pool replacement race
When pool creation races for the same host, a slower attempt can
overwrite a pool that another thread already published and close
connections with in-flight requests.
Capture the previous pool before connection setup, then compare
that state under the session lock before publishing the new pool.
If another thread changed the pool, discard the stale pool instead
of replacing the current one.
Keep pool removals behind the same lock so the check observes all
writers.
Fixes: #3171 parent d83adab commit d8530e8
1 file changed
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3241 | 3241 | | |
3242 | 3242 | | |
3243 | 3243 | | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
3244 | 3247 | | |
3245 | 3248 | | |
3246 | 3249 | | |
| |||
3256 | 3259 | | |
3257 | 3260 | | |
3258 | 3261 | | |
3259 | | - | |
3260 | 3262 | | |
3261 | 3263 | | |
3262 | 3264 | | |
| |||
3276 | 3278 | | |
3277 | 3279 | | |
3278 | 3280 | | |
3279 | | - | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
| 3287 | + | |
| 3288 | + | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
3280 | 3295 | | |
3281 | 3296 | | |
3282 | 3297 | | |
| |||
3287 | 3302 | | |
3288 | 3303 | | |
3289 | 3304 | | |
3290 | | - | |
| 3305 | + | |
| 3306 | + | |
3291 | 3307 | | |
3292 | 3308 | | |
3293 | 3309 | | |
| |||
0 commit comments