Commit e87c70c
committed
Improve release of broken connection when pool is full
Release operation discards the connection if it is broken. It also tries
to resolve a pending acquisition request, if any. In order to this it
tries to execute a promise-free internal acquire that immediately
returns an available resource or creates a new one, if possible. New
resource can only be created if pool is not at its maximum capacity.
Previously, release operation only decremented the active connection
counter at the end. This made it impossible to create a new connection
when broken one is returned.
This commit fixes the problem by making `Pool#_release()` decrement
the active counter after connection has been either added to the list
of idle connections or discarded because it turned out to be broken.1 parent 0dd57b4 commit e87c70c
2 files changed
+36
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| |||
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| 168 | + | |
167 | 169 | | |
168 | 170 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 171 | | |
173 | 172 | | |
174 | 173 | | |
175 | 174 | | |
176 | 175 | | |
177 | | - | |
178 | | - | |
179 | 176 | | |
180 | 177 | | |
181 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
525 | 559 | | |
526 | 560 | | |
527 | 561 | | |
| |||
0 commit comments