Closed andrewcox closed 6 years ago
Why would you ever need two thrift servers in one service?
Henning: this is a legacy artifact that Sam decided to host two functionally separate components, Router and Writer in Calligraphus in the same jvm. Removing this needs some work.
There are a few reasons I can think of, and at least a handful of servers that do this. One potential reason is that if you are rate-limiting your server under overload, you might want to have a separate monitoring server so that tupperware won't get rate-limited checking your health and restart you. Another is if you are writing a proxy and you want to even have fb303 requests proxied, but you also want to expose your own monitoring information via a second service (this is what servicerouter proxy does).
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.
Because ThriftServer and ThriftServiceProcessor are bound as singletons, it is difficult to create two swift servers (listening on two different ports) via guice.
We should either come up with some module changes that make this feasible, or else add instructions recommending child injectors for this.