uber / tchannel-python

Python implementation of the TChannel protocol.
MIT License
76 stars 45 forks source link

Calls made to specific host:port should not add to the peer list #464

Open prashantv opened 7 years ago

prashantv commented 7 years ago

If a call is made with hostport=..., then the value is added as a new peer to the peer list. If the user has a shared peer list, but explicitly wants to talk to some other service directly, then the pollution means the direct service host:port is now part of the shared peer lists, and any call could use this host:port.

Comment from @abhinav:

The fix for this is not too complicated. We need to change the peer
selection code to not add the hostport to the list of peers if it was
specified explicitly.

Right now, choose does get(hostport) when the hostport is
specified explicitly. get calls add if the hostport is not a known
peer.

https://github.com/uber/tchannel-python/blob/master/tchannel/tornado/peer.py#L706
https://github.com/uber/tchannel-python/blob/master/tchannel/tornado/peer.py#L637

Instead we will have to change it to build a Peer but not add it to
the list when hostport is specified.