-
Notifications
You must be signed in to change notification settings - Fork 37
dialer v1 may not clean up succeeded but unselected connections #123
Comments
This bug may underlie the effects observed in #79. |
Printing out multiple connections during trimming reveals that there are peers with multiple TCP connections to the relay (up to 6 observed). Sample:
|
Adding some logs to catch the duplicate connections when they happen, the plot thickens: the duplicate connections are very close to each other temporaly:
|
Update: this was a false alarm, we do close unselected connections. |
We still have no explanation as to why all these duplicate connections. |
@vyzo could be js? Not sure. However, we never close fully established connections. Instead, we try to just pick one connection and keep using it. Ideally, we'd have some background logic to close idle, duplicate connections. Well, ideally we'd have migration... |
Note: the dialer definitely throws all but one connection away. |
So when the dialer throws away connections it doesn't want, does it also close them? |
It does unless we have both a connection and a non-nil error... see |
The dialer behaves well in this regard. |
@vyzo's investigations on the relay infrastructure yielded a good lead on why the connection manager may be closing less connections than expected: we may actually be holding more than one connection per peer.
Going through dialer v1, there is one edge case where this can happen, and I don't think it's so much of an edge, but rather a hot path:
The text was updated successfully, but these errors were encountered: