Commit 6859bf7
committed
Fix dangling timer when lazy connection closes with pending commands
This is a somewhat hidden and rare race condition. The faulty idle timer
would be started when the underlying Redis connection closes while the
lazy connection still has pending commands, such as a blocking BLPOP
operation. The timer would trigger some timer after the connection has
been closed and would try to close the connection again, thus
referencing undefined variables and causing a hard error in this case.
The idle timer should not be started when the connection is already
closed.1 parent 82ac345 commit 6859bf7
2 files changed
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
576 | 603 | | |
577 | 604 | | |
578 | 605 | | |
| |||
0 commit comments