Commit f8ca923
committed
fix(pooling): fix race conditions, deadlock, and connection leak in PoolEntry
Fix a relocated ABBA deadlock: `PoolEntry.connect()`/`internalConnect()` no longer hold the entry monitor across `client.connect()`, which would deadlock with the Netty close-callback path on the shared `ConnectionImpl` monitor during a close/reconnect overlap.
Fix `onConnectionClosed` accounting: the `PoolEntry` shutdown idempotency flag is now reset per connection generation, so a KILL/reconnect cycle emits one close event per generation instead of suppressing all closes after the first.
`IProtoClientPoolImpl.forEach()` snapshots clients under the pool lock and invokes the action outside it, avoiding `ConcurrentModificationException` under concurrent `setGroups()` without holding the lock across a user callback.1 parent 3d7d7a1 commit f8ca923
2 files changed
Lines changed: 8 additions & 30 deletions
File tree
- tarantool-pooling/src
- main/java/io/tarantool/pool
- test/java/io/tarantool/pool/integration
Lines changed: 4 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 170 | + | |
| 171 | + | |
177 | 172 | | |
178 | 173 | | |
179 | 174 | | |
| |||
431 | 426 | | |
432 | 427 | | |
433 | 428 | | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
| 429 | + | |
| 430 | + | |
441 | 431 | | |
442 | 432 | | |
443 | 433 | | |
| |||
465 | 455 | | |
466 | 456 | | |
467 | 457 | | |
468 | | - | |
469 | | - | |
470 | 458 | | |
471 | 459 | | |
472 | 460 | | |
| |||
505 | 493 | | |
506 | 494 | | |
507 | 495 | | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | 496 | | |
513 | 497 | | |
514 | 498 | | |
| |||
Lines changed: 4 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 97 | + | |
| 98 | + | |
101 | 99 | | |
102 | 100 | | |
103 | 101 | | |
| |||
119 | 117 | | |
120 | 118 | | |
121 | 119 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
| 120 | + | |
| 121 | + | |
128 | 122 | | |
129 | 123 | | |
130 | 124 | | |
| |||
0 commit comments