Jing Yan


Posted August 3, 2021

Summer Update 2021 🐬

Shall I compare thee to a summer’s day? With blooms 🌸 and breezes 🍃, comes our Q2 update!

Tech Debts Grooming

Every quarter, we spend a sprint to team up and kill tech debt ⚔️! This quarter, we set our minds on migrations, deprecations, and user API improvements. During this time, we migrated and removed the deadwood ServerBuilder, removed FilteredThriftClientModule in Finatra, cleaned up Finagle Memcached Client, and improved the overall user experience in TwitterServer Admin UI.

Centralized Serverset Weights in Finagle LoadBalancer

Introducing a new weight-aware load balancer, which allows serverset weights to work with dAperture.

Finagle MySql

Introduced embedded MySql integration test utilities, which bootstrap the MySql instance programmatically when given the path to the respective mysqld binary. The package provides a fixture that allows integration tests/suite to easily make use of the bootstrapped instance. As a result, running integration suites in various environments only requires pointing to the location of the respective extracted mysql binaries. To further enhance the Finagle MySql testing framework, we added an EmbeddedSimpleSuite to the test utilities to allow writing tests without creating a client for each test, and migrated Finagle MySql integration tests to the new testing framework!


We removed all HTTP/2 related toggles within Finagle, making HTTP/2 the default HTTP implementation for Finagle clients and servers!

New Util Validation and Util Jackson frameworks

Validation and Jackson are helpful frameworks to be used independently or as an integration in Finatra. Therefore, we have moved them from Finatra to Util to serve more use cases.The new Util Validation framework has been upgraded to be fully JSR 380 compatible by wrapping the Hibernate Validator Java library. The new Util Jackson framework has also been upgraded to support Bean 2.0 validation style, with better support for the JsonDiff API, as well as a new out-of-box support for YAML validation and deserialization by providing a YAML object mapper. As a result, Finatra Validation and Jackson are moved to depend on the Util Validation and Util Jackson frameworks respectively. There are no functional changes for existing Finatra services.

Non broadcast version of Dtab.local

Introduce Dtab.limited, a process-local Dtab that will NOT be remotely broadcasted for any protocol, whereas Dtab.local will be broadcasted for propagation on supported protocols. For path name resolution, the Dtab.local will take precedence over the Dtab.limited if the same path is defined in both, and both take precedence over the Dtab.base. The existing Dtab.local request propagation behavior remains unchanged.

Metrics Metadata

Twitter-Server now bears an expression endpoint (version 1.0), which exports Finagle server’s latency, throughput, success rate, and admission control expressions by default. It also provides versatile attributes to support use cases like multi-tenancy systems. We have made many improvements to Metric Metadata and Expression endpoints, including hydrating richer data, enhancing query ability for consumers, and specifying more definite metric types.

Offload Admission Control

The Offload Admission Control project continues to show promise! The algorithm was tweaked to use a surprisingly simple way to measure queue latency that appears to be a bit more responsive than queue depth, resulting in somewhat better performance but more importantly an easier model to reason about. It’s been turned on for a couple of interesting services so far. For one service that is entirely throughput focused, the new algorithm gives similar performance but with better response windows, lowering it from 5 seconds to 125 milliseconds. Perhaps even more exciting results observed during the adoption by another service. With some awesome improvements they were able to turn on offload admission control and see a 30% improvement in throughput over their previous configuration. Based on the great success we’re seeing so far, we’re experimenting in Q3 to see if we can turn on OffloadFilter and OffloadAdmissionControl as the default configuration for services.

TLS Snooping for Mux

We added support for TLS snooping to the mux protocol. This allows a thriftmux server to start a connection as TLS or follow the existing upgrade pathway at the leisure of the client. This allows the server to require encryption via mux opportunistic TLS and still be able to downgrade to vanilla thrift over TLS.

Till next time, Jing (on behalf of CSL)