Commit b04761e
authored
PhysicalBridge: Fix orphaning cases of PhysicalConnection where it never finishes (#2338)
What happens here is that `PhysicalConnection` attempts to connect but never hears back, so it's stuck in `State.ConnectedEstablishing` state, which is handled in the heartbeat code. In the situation where the "last write seconds ago" passes in the heartbeat and we haven't heard back, we fire an `PhysicalBridge.OnDisconnected()` which clears out `physical` and orphans the socket listening forever. This now properly disposes of that `PhysicalConnection` mirroring like we do in `State.Connecting` which will properly fire `OnDisconnected()` and clean up the orphan socket.
The situation manifests where we establish a TCP connection, but not a Redis connection. All of the cases in the memory dump we're analyzing are some bytes sent and 0 received. Likely a Redis server issue, but the client is then handling it incorrectly and leaking.
I nuked the unused `RemovePhysical` method just to prevent further oops here.
Addresses a new case of #1458.1 parent c4e5453 commit b04761e
2 files changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
545 | | - | |
| 545 | + | |
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
550 | 555 | | |
551 | 556 | | |
552 | 557 | | |
| |||
576 | 581 | | |
577 | 582 | | |
578 | 583 | | |
| 584 | + | |
579 | 585 | | |
580 | 586 | | |
581 | 587 | | |
| |||
614 | 620 | | |
615 | 621 | | |
616 | 622 | | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | 623 | | |
621 | 624 | | |
622 | 625 | | |
| |||
0 commit comments