uber / tchannel

network multiplexing and framing protocol for RPC
MIT License
1.15k stars 129 forks source link

Add peer no-preference selection strategy #1289

Closed ShanniLi closed 8 years ago

ShanniLi commented 8 years ago

r @jcorbin @kriskowal @Raynos

Tested with Ringpop and observed the 2x connection issue gone.

anson627 commented 8 years ago

so xlate egress should specify PreferOutgoing, since it only make outbound calls?

kriskowal commented 8 years ago

We’ll also need preferIncoming for service channels speaking to Hyperbahn, so they favor connections from their affine nodes. The eventual API should be preferConnectionDirection: 'incoming' | 'outgoing' | null to avoid weird cases like preferIncoming: true, preferOutgoing: true. Other than that, this looks solid.

ShanniLi commented 8 years ago

@anson627 xlate egress is a hyperbahn service, right? If so, it should prefer incoming.

Raynos commented 8 years ago

We should add some tests.

test('prefer outgoing creates new conn even if incoming');
test('prefer any re-uses incoming conn and does not open outgoing conn');
Raynos commented 8 years ago

The main aim of tests is:

Raynos commented 8 years ago

lgtm