Permalink
Browse files

finagle-mux: remove ref-counting control toggle

Summary: Problem / Solution

The ref-counting control toggle has been at 100% for over
two months so it's safe to assume that it's ready to be
the exclusive option.

JIRA Issues: CSL-5033

Differential Revision: https://phabricator.twitter.biz/D80225
  • Loading branch information...
dschobel authored and jenkins committed Aug 14, 2017
1 parent 7610016 commit f432bd443c4998431e4cbfeb6934916e7310c9a8
View
10 CHANGES
@@ -44,6 +44,12 @@ New Features
* finagle-init: Introduce a module to support service-loading initialization
code. ``PHAB_ID=D75950``
* finagle-mux: Default to new more efficient decoder. ``PHAB_ID=D80225``
* finagle-mysql: `IsolationLevel` support was added with
`Transactions.transactionWithIsolation` method, so the default level can be overridden
at the transaction level. ``PHAB_ID=D68944``
* finagle-mysql: Add support for unsigned integers. When enabled, unsigned integers that do
not fit into the existing signed representation are widened. For example an unsigned
Int32 is represented as a Java Long, etc. Because this changes the `c.t.f.mysql.Value`
@@ -58,10 +64,6 @@ New Features
* finagle-netty4: `KeyCredentials.CertKeyAndChain` is now available to use with
`Netty4ServerEngineFactory`. ``PHAB_ID=D80494``
* finagle-mysql: `IsolationLevel` support was added with
`Transactions.transactionWithIsolation` method, so the default level can be overridden
at the transaction level. ``PHAB_ID=D68944``
* finagle-stats: Metrics now report verbosity levels via `MetricsView.verbosity`.
``PHAB_ID=D78150``
@@ -1,10 +1,5 @@
{
"toggles": [
{
"id": "com.twitter.finagle.mux.RefCountControlMessages",
"description": "Use a ref-counting control plane as the transport implementation.",
"fraction": 0.0
},
{
"id": "com.twitter.finagle.mux.TlsHeaders",
"description": "Initiate sending tls headers.",
@@ -74,23 +74,10 @@ object Mux extends Client[mux.Request, mux.Response] with Server[mux.Request, mu
}
object MuxImpl {
private val RefCountToggleId: String = "com.twitter.finagle.mux.RefCountControlMessages"
private val TlsHeadersToggleId: String = "com.twitter.finagle.mux.TlsHeaders"
private val refCountControlToggle: Toggle[Int] = Toggles(RefCountToggleId)
private val tlsHeadersToggle: Toggle[Int] = Toggles(TlsHeadersToggleId)
private def refCountControl: Boolean = refCountControlToggle(ServerInfo().id.hashCode)
private[Mux] def tlsHeaders: Boolean = tlsHeadersToggle(ServerInfo().id.hashCode)
/**
* A [[MuxImpl]] that uses netty4 as the underlying I/O multiplexer.
*
* @note this is experimental and not yet tested in production.
*/
val Netty4 = MuxImpl(
params => Netty4Transporter.raw(CopyingFramer, _, params),
params => Netty4Listener(CopyingFramer, params)
)
/**
* A [[MuxImpl]] that uses netty4 as the underlying I/O multiplexer and
* ref-counts inbound mux control messages. No application changes are
@@ -121,11 +108,7 @@ object Mux extends Client[mux.Request, mux.Response] with Server[mux.Request, mu
params => Netty4Listener(CopyingFramer, params)
)
implicit val param = Stack.Param(
// note that ref-counting toggle is dependent on n4 toggle.
if (refCountControl) Netty4RefCountingControl
else Netty4
)
implicit val param = Stack.Param(Netty4RefCountingControl)
}
}
@@ -4,18 +4,6 @@ import com.twitter.finagle.Mux
import com.twitter.finagle.Mux.param.{MaxFrameSize, MuxImpl}
import com.twitter.conversions.storage._
class Netty4EndToEndTest extends AbstractEndToEndTest {
def implName: String = "netty4"
def clientImpl() = Mux.client.configured(MuxImpl.Netty4)
def serverImpl() = Mux.server.configured(MuxImpl.Netty4)
}
class FragmentingNetty4EndToEndTest extends AbstractEndToEndTest {
def implName: String = "netty4"
def clientImpl() = Mux.client.configured(MuxImpl.Netty4).configured(MaxFrameSize(5.bytes))
def serverImpl() = Mux.server.configured(MuxImpl.Netty4).configured(MaxFrameSize(5.bytes))
}
class Netty4RefCountingControlEndToEndTest extends AbstractEndToEndTest {
def implName: String = "netty4"
def clientImpl() = Mux.client.configured(MuxImpl.Netty4RefCountingControl)
@@ -137,11 +137,7 @@ class EndToEndTest
.name("ThriftMuxServer")
.bindTo(new InetSocketAddress(0))
.build(pfSvc)
val protoNew = ThriftMux.server
.withProtocolFactory(pf)
.serveIface(new InetSocketAddress(InetAddress.getLoopbackAddress, 0), iface)
val netty4 = ThriftMux.server
.configured(Mux.param.MuxImpl.Netty4)
.withProtocolFactory(pf)
.serveIface(new InetSocketAddress(InetAddress.getLoopbackAddress, 0), iface)
@@ -150,7 +146,7 @@ class EndToEndTest
Seq(
("ServerBuilder", builder, port(builder.boundAddress)),
("ThriftMux with Netty4", netty4, port(netty4.boundAddress))
("ThriftMux", netty4, port(netty4.boundAddress))
)
}
@@ -176,11 +172,6 @@ class EndToEndTest
.withClientId(clientId)
.withProtocolFactory(pf)
.newService(dest)
val netty4 = ThriftMux.client
.withClientId(clientId)
.withProtocolFactory(pf)
.configured(Mux.param.MuxImpl.Netty4)
.newService(dest)
def toIface(svc: Service[ThriftClientRequest, Array[Byte]]): TestService$FinagleClient =
new TestService.FinagledClient(svc, pf)
@@ -189,8 +180,7 @@ class EndToEndTest
("ThriftMux via ClientBuilder", toIface(builder), builder),
("Thrift via ClientBuilder", toIface(thriftBuilder), thriftBuilder),
("Thrift via proto", toIface(thriftProto), thriftProto),
("ThriftMux proto", toIface(newProto), newProto),
("ThriftMux with Netty4", toIface(netty4), netty4)
("ThriftMux proto", toIface(newProto), newProto)
)
}

0 comments on commit f432bd4

Please sign in to comment.