Skip to content
CAI
Software that uses CAICheck a score

twitter/finagle

74.6

Strong · 27 September 2026

112.8k

lines of production code

Scala

primary language

3

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Finagle is a high-performance, protocol-agnostic RPC system for Scala and Java that enables the construction of resilient client and server services. It provides a stack-based architecture for composing filters and load balancing strategies across a wide range of protocols, including HTTP, Thrift, MySQL, Redis, and Memcached. The system integrates deeply with Netty 4 for transport, offering robust support for TLS, compression, and distributed tracing via Zipkin and OpenCensus.

How it got here

2010–2013 — Stack-based architecture and build modernization

57 changes.

This period focused on migrating Finagle to a modular, stack-based architecture with the new MethodBuilder API, replacing legacy client and server builders. The project simultaneously modernized its infrastructure by upgrading to SBT 1.7.1, integrating Bazel build support, and updating core dependencies like Netty and Jackson. These structural changes were accompanied by expanded test coverage and documentation updates to reflect the new patterns across HTTP, Thrift, MySQL, and Memcached modules.

2014–2016 — Netty 4 migration and Java API expansion

79 changes.

This period focused on migrating Finagle's transport layer from Netty 3 to Netty 4, introducing a new backend with optimized buffer handling, proxy support, and SSL improvements. Concurrently, the project significantly expanded Java interoperability by adding comprehensive compilation tests and utility classes for core APIs, while establishing a robust feature toggle system to manage these transitions.

2017–2019 — Netty 4 migration and Java API expansion

65 changes.

This period focused on migrating Finagle's core transport and codec layers to Netty 4, introducing new engine factories, timer implementations, and push-session support. It simultaneously expanded Java compatibility by adding dedicated wrapper classes for SSL, liveness, and stack configuration, while significantly broadening test coverage across HTTP/2, Memcached, and load balancing components.

2020–2024 — Experimental routing and observability features

16 changes.

This period focused on introducing experimental HTTP and method-based routing capabilities alongside a new Scribe logging client. Significant effort was also dedicated to enhancing observability through Zstandard compression support, detailed Netty thread monitoring, and slow request tracing. The work was heavily supported by comprehensive test coverage, including new integration test harnesses for MySQL and PostgreSQL databases.

Features

Add CPU and socket usage tracking for Netty worker threads

The \EventLoopGroupTracker\ now instruments Netty worker threads to report CPU utilization, active socket counts, and pending task metrics. Users can enable this tracking by calling \EventLoopGroupTracker.track\, which injects periodic monitoring tasks into the specified \EventLoopGroup\. These tasks collect histograms for CPU usage (\cpu\_util\), active sockets (\all\_sockets\), and pending tasks (\pending\_tasks\), as well as a counter for CPU time (\cpu\_time\_ms\). If a \dumpThreshold\ is configured, the tracker also logs warnings and thread stack traces when execution delays exceed the threshold, aiding in the diagnosis of thread contention or blocking.

finagle-netty4/src/main/scala/com/twitter/finagle/netty4/threading · high confidence

Add Finagle example Thrift service definitions and build configuration

This change introduces the Thrift interface definitions for the Finagle example application, specifically adding a 'Hello' service with a 'hi' method and a 'LoggerService' with logging and size-checking capabilities. It also includes the corresponding BUILD file to generate Java and Scala client libraries from these definitions using the scrooge3 code generator, making these example services available for use in the Finagle ecosystem.

finagle-example/src/main/thrift · high confidence

Add Flask and Flask Small Sphinx documentation themes

Added the 'flask' and 'flask\_small' Sphinx themes to the documentation build system. These new themes provide a distinct visual style for the generated documentation, including custom CSS layouts, typography, and a Pygments syntax highlighting style named 'FlaskyStyle'. The 'flask' theme includes support for Apple touch icons and Google Analytics tracking, while the 'flask\_small' variant is configured for a sidebar-less layout with a GitHub fork ribbon.

_doc/src/sphinx/\themes · high confidence

Add Java HTTP example with Finagle filters and routing

The finagle-example module now includes a complete Java-based HTTP server example. This adds a CatService backed by an in-memory store, an HttpMuxer routing /cat requests, and a chain of Finagle filters for access logging, handling null responses as 404s, and converting exceptions to appropriate HTTP error statuses.

finagle-example/src/main/java/com/twitter/finagle/example/java/http · high confidence

Add Java Thrift client and server examples

New Java example files (ThriftClient.java and ThriftServer.java) have been added to the finagle-example module, demonstrating how to build a Thrift client and server using the Java API. The client example shows how to create a client, make a remote call, and handle the response using Future callbacks, while the server example illustrates implementing a Thrift service interface and serving it on a specified port.

finagle-example/src/main/java/com/twitter/finagle/example/java/thrift · high confidence

Add Memcached Proxy example

A new example application, MemcachedProxy, is introduced to demonstrate how to build a protocol-aware proxy for Memcached. The example runs a server on port 8080 that delegates all incoming Memcached requests to a backend server on port 11211, illustrating how to decode and multiplex Memcached protocol messages.

finagle-example/src/main/scala/com/twitter/finagle/example/memcachedproxy · high confidence

Add MuxCancelledCategorizer for client-discarded request exceptions

A new MuxCancelledCategorizer has been added to the stats module to identify and categorize exceptions caused by ClientDiscardedRequestException. This allows the system to properly recognize and label these specific cancellation events in metrics and logs, improving observability for requests discarded by the client.

finagle-mux/src/main/scala/com/twitter/finagle/mux/stats · high confidence

Add SlowTracesFilter to log slow requests with trace IDs

The finagle-logging module now includes a new SlowTracesFilter that monitors request latency and logs debug information for requests that exceed a specified percentile threshold. When a request is slower than the configured percentile (e.g., p99) and is actively sampled by tracing, the filter logs the trace ID, the percentile latency value, and the measured request latency. This helps identify performance bottlenecks by providing visibility into slow requests within the tracing system.

finagle-logging · high confidence

Add Thrift micro-benchmark definitions for Finagle

A new Thrift micro-benchmark has been added to the finagle-benchmark-thrift module, introducing a 'Hello' service with an echo method and a 'ThriftOneGenServer' service. The benchmark utilizes a 'Request' and 'Response' struct containing various data types (integers, booleans, strings, lists, maps, and sets) to exercise the Thrift codec. The build configuration generates Java and Scala code from these definitions using the Java 8 platform.

finagle-benchmark-thrift · high confidence

Add Zstandard (Zstd) streaming compression and decompression for Netty4

This change introduces native Zstd support to the finagle-netty4 codec layer, enabling clients and servers to compress and decompress network traffic using the Zstd algorithm. The implementation includes a streaming encoder (ZstdStreamingEncoder) and decoder (ZstdDecoder) that integrate with Netty's ByteBuf handling, leveraging the zstd-jni library for efficient direct-buffer operations. This allows for improved bandwidth utilization and reduced latency for compatible connections, particularly within the mux protocol.

finagle-netty4/src/main/java · high confidence

Add experimental OpenCensus tracing integration for Finagle HTTP and ThriftMux

This change introduces a new \finagle-opencensus-tracing\ module that allows Finagle HTTP and ThriftMux clients and servers to participate in distributed tracing via OpenCensus. Users can enable this by calling \.withOpenCensusTracing\ on their client or server stacks; the client filter injects trace context into outgoing requests, while the server filter extracts it to continue the trace. The module supports standard B3 propagation and includes syntax helpers for managing span lifecycles in Scala.

finagle-opencensus-tracing · high confidence

Add includecode Sphinx directive for selective code inclusion

A new Sphinx extension, \includecode\, is introduced to allow documentation to include specific sections of external code files. This directive supports filtering content by section markers, excluding or including specific blocks, and handling indentation normalization, enabling more modular and maintainable code examples in the generated documentation.

doc/src/sphinx/exts · high confidence

Added Finagle ZooKeeper service discovery example

Added two Scala files to the finagle-example project demonstrating how to register and discover services using Apache ZooKeeper. The ServiceProvider component starts an HTTP echo server on port 8080 and registers it with ZooKeeper, while the ServiceConsumer component discovers and calls that service via ZooKeeper-based address resolution.

finagle-example/src/main/scala/com/twitter/finagle/example/zookeeper · high confidence

Added HTTP stress test example

A new stress test utility has been added to the Finagle examples, allowing users to send a high volume of concurrent HTTP requests to a target server to evaluate performance and stability. The tool accepts command-line arguments for the target URI, concurrency level, and total request count, utilizing an asynchronous semaphore to throttle load. It reports completion metrics, including requests per second, error counts, and a breakdown of HTTP response statuses, while also printing detailed statistics from the Finagle client.

finagle-example/src/main/scala/com/twitter/finagle/example/stress · high confidence

Added MySQL protocol documentation and SBT launcher script

This change introduces new documentation assets for the Finagle MySQL protocol. It adds a Scala code example (\mysql.scala\) demonstrating how to configure a MySQL client with credentials, database selection, and connection pooling, including both standard and rich client usage patterns for executing queries. Additionally, it includes a new executable shell script (\sbt\) that downloads and verifies the SBT launcher (version 1.3.10) from Maven Central using SHA-1 checksums, ensuring a consistent build environment for the documentation examples.

doc/src/sphinx/code/protocols · high confidence

Added Redis client example demonstrating basic set/get operations

A new example file, RedisClient.scala, has been added to the finagle-example project. It demonstrates how to initialize a Redis cluster, create a Finagle Redis client, perform basic set and get operations using Buf, and properly close the client connection.

finagle-example/src/main/scala/com/twitter/finagle/example/redis · high confidence

Added Wireshark dissector for the Mux protocol

Users can now install the new \mux\_dissector.lua\ plugin to decode Finagle Mux protocol traffic directly in Wireshark or tshark. The dissector provides basic decoding of Mux messages, including frame length, message type, and tag number, with additional context and destination decoding for Tdispatch messages. It includes a heuristic detector for automatic recognition and supports TCP segment reassembly for Wireshark versions 1.99.2 and higher.

finagle-mux/src/main/lua · high confidence

Added benchmarking scripts for load balancer latency analysis

New shell and R scripts have been added to the benchmarking suite to automate the collection and visualization of load balancer performance data. The shell script executes simulations for Round Robin, Power of Two Choices (p2c), and Exponentially Weighted Moving Average (EWMA) strategies under various conditions (normal, cold start, and slow-middle scenarios), extracting latency metrics. The accompanying R script processes these results to generate latency distribution graphs, helping users compare how different load balancers handle tail latency and backend instability.

finagle-benchmark/src/main/scripts · high confidence

Experimental fiber scheduler for high-performance Future execution

An experimental fiber scheduler has been added to finagle-exp, providing a high-performance mechanism for executing Future computations via load balancing, work stealing, and continuation affinity. Fibers created via fork methods persist across async boundaries, allowing nested continuations to execute within the same fiber. The scheduler features an adaptive size mechanism that automatically adjusts worker threads to optimize throughput while avoiding container limits like CPU throttling and memory usage. It can be enabled via the \com.twitter.finagle.exp.scheduler\ flag and supports both fixed and adaptive worker configurations.

finagle-exp/src/main · high confidence

Experimental flag for local Memcached usage

A new experimental flag, localMemcachedPort, has been added to the finagle-memcached module, allowing users to specify a port for a local Memcached instance. This feature serves as a temporary workaround for local development and testing, with a known restriction that it cannot be used if a service connects to multiple Memcached clusters. The implementation includes a GlobalFlag to parse the port number and helper methods in the LocalMemcached object to check if the feature is enabled and retrieve the configured port.

finagle-memcached/src/main/scala/com/twitter/finagle/memcached/exp · high confidence

Experimental garbage collection avoidance for Finagle Mux

Adds an experimental GC avoidance mechanism to the Finagle Mux lease system, allowing servers to coordinate garbage collection pauses with request draining to reduce latency spikes. This feature introduces a suite of internal components in the \finagle.mux.lease.exp\ package, including a \ClockedDrainer\ thread that monitors JVM memory and garbage collection events, a \WindowedByteCounter\ to track allocation rates, and a \Coordinator\ that manages the lifecycle of draining and GC cycles. The implementation supports both Parallel GC and ParNew+CMS collectors, uses a \RequestSnooper\ to estimate request handling times, and allows configuration via flags such as \com.twitter.finagle.mux.lease.exp.drainerEnabled\ and \com.twitter.finagle.mux.lease.exp.drainerDiscountRange\. This is an experimental feature subject to change and is not yet enabled by default.

finagle-mux/src/main/scala/com/twitter/finagle/mux/lease · high confidence

Extract base HTTP components into finagle-base-http

The base HTTP functionality has been extracted into a new finagle-base-http module, making it available as a distinct library for users who need HTTP support without the full Finagle stack. This extraction is accompanied by the addition of Bazel build configuration and project ownership metadata for the new module.

finagle-base-http · high confidence

Extract core Zipkin tracing components into a new finagle-zipkin-core module

The transport-agnostic logic for Zipkin tracing has been extracted from finagle-zipkin-scribe into a new \finagle-zipkin-core\ library. This module introduces a \RawZipkinTracer\ base class for handling span recording, a \DeadlineSpanMap\ to buffer spans and manage hold/flush timers, and a \DurationFilteringTracer\ that persists only spans exceeding a configurable duration threshold. It also provides a \DefaultSampler\ that respects an \initialSampleRate\ global flag and a \SamplingTracer\ that records the sampling rate as a binary annotation. This refactoring isolates the core tracing mechanics, allowing other modules to implement specific transports without duplicating span management and sampling logic.

finagle-zipkin-core · high confidence

Finagle documentation build system and diagrams added

The documentation build process is now supported via a new Makefile that converts .pic diagram sources into PNG images using groff and ImageMagick. A README has been added to guide users in generating the user guide website locally using SBT and Sphinx, and a PROJECT file defines CSL-team:ldap as the owners. Additionally, several new diagram files (including service, filter, and load-balancer stacks) and source graphics have been introduced to illustrate Finagle's architecture.

doc · high confidence

HTTP service routing and response classification utilities

This change introduces new utilities in the \finagle-http\ service layer to improve request handling and error management. It adds \RoutingService\, which allows users to compose multiple services based on HTTP path or method-and-path patterns, automatically returning a 404 Not Found when no route matches. Additionally, it provides \HttpResponseClassifier\ with a default \ServerErrorsAsFailures\ classifier that correctly categorizes 5xx responses, ensuring that retryable network nacks are treated as retryable failures rather than non-retryable server errors. Supporting services like \NotFoundService\ and \NullService\ are also included to facilitate testing and standard response behaviors.

finagle-http/src/main/scala/com/twitter/finagle/http/service · high confidence

Introduce Finagle HTTP/1.1 implementation based on Netty 4

This change introduces a new \finagle-netty4-http\ module that provides the core HTTP/1.1 client and server implementation using Netty 4. It includes the necessary pipeline handlers for encoding and decoding HTTP messages, validating headers and URIs, handling multipart form data, and managing streaming responses. The module also adds support for content compression and decompression, and integrates with Finagle's stack-based architecture to allow for configurable behavior such as streaming and fixed-length message aggregation.

finagle-netty4-http · high confidence

Introduce Finagle Scribe client

Adds a new \finagle-scribe\ module providing a \Publisher\ for sending log entries to a Scribe server. The client includes a builder for configuring the destination, retry policies, and filters, and automatically tracks metrics such as success, \TryLater\, and error counts.

finagle-scribe · high confidence

Introduce HTTP and SOCKS5 proxy support for Finagle Netty4

This change adds new internal handlers (\HttpProxyConnectHandler\ and \Netty4ProxyConnectHandler\) to the Finagle Netty4 module, enabling clients to connect through HTTP and SOCKS5 proxies. The HTTP proxy handler implements the CONNECT tunneling procedure, buffering writes during the handshake and properly handling proxy authentication and response status codes. The SOCKS5 handler leverages Netty's built-in proxy support and includes logic to bypass proxies for localhost connections. Additionally, the implementation ensures that HTTP proxy destinations prefer hostnames over IP addresses to comply with stricter proxy server requirements.

finagle-netty4/src/main/scala/com/twitter/finagle/netty4/proxy · high confidence

Introduce Java-friendly Memcached client API

A new Java-specific client interface, \JavaClient\, has been added to the \finagle-memcached\ module to provide a more idiomatic API for Java users. This abstract class exposes standard memcached operations such as get, set, add, delete, and compare-and-set (CAS), along with helper methods for string values. It is accompanied by a \ResultWithCAS\ class to handle retrieval results that include CAS tokens, enabling Java applications to interact with the underlying Scala-based Finagle service using familiar Java patterns.

finagle-memcached/src/main/java/com · high confidence

Introduce MethodBuilder for HTTP client configuration

The \MethodBuilder\ class is now available in \finagle-http\ to provide a higher-level, method-specific client configuration API that supersedes the deprecated \ClientBuilder\. It allows users to define distinct timeouts, retry policies, and response classifiers for individual endpoints (methods) while sharing a single underlying Finagle client, which reduces resource overhead and improves metric scoping. The builder supports migration from \ClientBuilder\ and integrates with the new stack-based client construction.

finagle-http/src/main/scala/com/twitter/finagle/http · high confidence

Introduce MethodBuilder for per-method ThriftMux client configuration

The finagle-thriftmux module now provides a \MethodBuilder\ API that allows users to configure timeouts, retries, and response classification on a per-method basis while sharing a single underlying Finagle client. This replaces the deprecated \ClientBuilder\ approach, reducing resource overhead (metrics, heap, file descriptors) by avoiding the creation of separate clients for methods with different characteristics. The module also includes a \DynamicPartitioningService\ for per-request partitioning strategies, a \MuxDowngradingNegotiator\ to handle protocol negotiation and fallback to vanilla Thrift, and Java-compatible builders and end-to-end tests.

finagle-thriftmux · high confidence

Introduce Netty 4 ChannelTransport implementation

Added a new \ChannelTransport\ implementation for Finagle that uses Netty 4's \Channel\ as the underlying transport mechanism. This includes a dedicated \ChannelTransportContext\ to expose connection details and SSL session information, enabling Finagle to leverage Netty 4's socket channel capabilities for handling inbound and outbound data streams.

finagle-netty4/src/main/scala/com/twitter/finagle/netty4/transport · high confidence

Introduce Netty 4 backend for Finagle

Finagle now supports a new Netty 4 transport layer, providing an alternative to the existing Netty 3 implementation. This change introduces core components for client and server connections, including \ConnectionBuilder\ for establishing connections and \ListeningServerBuilder\ for accepting them, with support for both standard NIO and native Epoll transports. It adds a \ByteReader\ implementation to handle byte buffers, an asynchronous DNS resolver for improved name resolution, and a configurable hashed-wheel timer for scheduling tasks. The backend also includes initialization logic to tune Netty 4 memory allocation, enable reference leak detection, and export detailed pooling and worker thread metrics.

finagle-netty4/src/main/scala/com/twitter/finagle/netty4 · high confidence

Introduce Netty 4 push-session transport and listener implementations

Added new \Netty4PushChannelHandle\, \Netty4PushListener\, and \Netty4PushTransporter\ classes in the \finagle-netty4\ module to support push-based session protocols. These components provide the underlying Netty 4 infrastructure for managing push channels, including SSL session info retrieval, serial execution of send operations, and listener/transporter wiring, enabling protocols that require direct access to the Netty pipeline to utilize the new push-session abstraction.

finagle-netty4/src/main/scala/com/twitter/finagle/netty4/pushsession · high confidence

Introduce TagMap and TagSet for efficient tag management

Added a new TagMap and TagSet implementation in the mux utility package to manage integer tags and their associated elements. TagMap provides methods to map, remap, and unmap elements to tags within a specified range, while TagSet handles the allocation and release of these tags using a BitSet for efficient memory usage. This change introduces a new internal data structure for tag management, improving performance and reducing synchronization points in the mux protocol.

finagle-mux/src/main/scala/com/twitter/finagle/mux/util · high confidence

Introduce consistent hashing partitioning service for Finagle clients

The finagle-partitioning module now provides a ConsistentHashPartitioningService that distributes requests across a dynamic group of nodes using a consistent hash ring. This service supports batched requests by splitting them into sub-requests routed to the correct partitions, and it allows for the optional ejection of unhealthy nodes from the hash ring based on failure accrual. A new PartitionNodeManager handles the mapping of logical partitions to physical hosts, enabling dynamic resharding as nodes are added or removed from the cluster.

finagle-partitioning · high confidence

Introduce experimental HTTP routing with path-based matching

This change introduces an experimental HTTP router in the \finagle-http\ module that routes requests based on the \Request.path\ (excluding query parameters). It adds new \Fields\ definitions (\ParameterMapField\ and \PathField\) to expose extracted route parameters and the memoized request path, and defines a \Route\ type alias for HTTP requests and responses within the experimental routing package.

finagle-http/src/main/scala/com/twitter/finagle/http/exp · high confidence

Introduce finagle-grpc-context module for gRPC Context propagation

A new finagle-grpc-context module has been added to allow gRPC Contexts to propagate across Twitter Future boundaries, functioning similarly to Utils Locals. This integration is currently marked as experimental.

finagle-grpc-context · high confidence

Introduce finagle-init module for service-loading initialization

A new finagle-init module has been added to support service-loading initialization code for Finagle applications. Users can now implement the com.twitter.finagle.FinagleInit trait and register their implementation via a META-INF/services resource file, allowing Finagle to discover and execute the module before other framework initialization code, though no ordering guarantees are provided when multiple modules are registered.

finagle-init · high confidence

Introduce finagle-stats-core module with Prometheus export and optimized histograms

This change extracts the core Finagle stats implementation into a new \finagle-stats-core\ module. It adds a new HTTP endpoint at \/admin/prometheus\_metrics\ that exports metrics in Prometheus format, including support for summaries, histograms, and metadata. The module introduces a high-performance, thread-safe \BucketedHistogram\ with exponential bucketing and a latched \MetricsBucketedHistogram\ for consistent snapshots. It also implements \CounterDeltas\ to support delta-based counter exports for compatibility with tools like Ostrich, and adds a fast, tail-recursive \Glob\ matcher for metric filtering. Additionally, it provides a lock-free \NonReentrantReadWriteLock\ optimized for ARM/aarch64 architectures to reduce contention on the metrics hot path.

finagle-stats-core · high confidence

Introduce finagle-toggle module for feature toggles

This change introduces the new \finagle-toggle\ module, providing a feature toggle system for Finagle and other libraries. It includes \StandardToggleMap\ for composing toggle sources (mutable, flags, JSON configs, service-loaded maps) with environment-specific overrides, \JsonToggleMap\ for parsing toggle configurations from classpath resources, and \ServiceLoadedToggleMap\ for dynamic discovery. The module also adds \ServerInfo\ for server identification and \WriteOnce\ for safe initialization, along with comprehensive tests for parsing, composition, and metric observation.

finagle-toggle · high confidence

Introduce finagle-zipkin-scribe for sending traces to Scribe

This change introduces the finagle-zipkin-scribe module, which provides a Finagle Tracer implementation that sends sampled Zipkin trace data to a local Scribe daemon. The module includes the ScribeZipkinTracer and ScribeRawZipkinTracer classes, a service loader configuration to automatically register the tracer, and build files for Bazel. Users can enable this tracing by adding the library to their classpath or explicitly configuring the server/client with ZipkinTracer, allowing distributed tracing data to be collected via the Scribe protocol.

finagle-zipkin-scribe · high confidence

Introduces MySQL-specific transport and buffer utilities

This change adds new internal components to the \finagle-mysql\ transport layer to better handle the MySQL protocol. \MysqlTransport\ wraps the underlying transport to ensure a proper \COM\_QUIT\ packet is sent before closing, with a timeout safeguard. \MysqlBuf\, \MysqlBufReader\, and \MysqlBufWriter\ provide specialized methods for reading and writing MySQL-specific data formats, including length-coded binary strings, null-terminated strings, and variable-length integers, all operating on little-endian byte order.

finagle-mysql/src/main/scala/com/twitter/finagle/mysql/transport · high confidence

Introduces new push-based Mux session implementation with TLS and compression negotiation

This change adds a new set of internal components in \finagle-mux/pushsession\ to handle the push-based Mux protocol, including \ClientTracker\ for managing request dispatches and tags, \MuxChannelHandle\ for threading Netty pipeline modifications, and dedicated negotiator classes (\MuxClientNegotiatingSession\, \MuxServerNegotiator\) that manage the handshake phase. The implementation introduces support for opportunistic TLS (OppTls) and compression negotiation during the connection setup, allowing clients and servers to dynamically enable encryption and data compression. It also includes \SharedNegotiationStats\ to efficiently track TLS and compression upgrade metrics across multiple connections without per-connection overhead, and \MuxServerSession\ to handle the active data plane with draining and shutdown logic.

finagle-mux/src/main/scala/com/twitter/finagle/mux/pushsession · high confidence

Introduces utility classes for concurrency, buffer handling, and parsing in Finagle Memcached

This change adds four new utility components to the \finagle-memcached\ module: \AtomicMap\ for fine-grained locking on hash tables to improve concurrency, \Bufs\ providing implicit conversions and extension methods for \Buf\ operations like splitting and numeric parsing, \NotFound\ for optimized set difference calculations to handle cache misses, and \ParserUtils\ for efficient byte-level parsing of integers and whitespace-delimited tokens. These utilities support the core memcached protocol implementation by reducing allocations and improving performance in key validation and decoding paths.

finagle-memcached/src/main/scala/com/twitter/finagle/memcached/util · high confidence

Introduction of Netty4Timer implementation

A new \Netty4Timer\ class has been added to the \finagle-netty4\ module, providing a \Timer\ implementation backed by Netty 4's native timer. This component wraps Netty's \io.netty.util.Timer\ to handle both one-time and periodic task scheduling, allowing the Netty 4 transport layer to leverage Netty's internal scheduling mechanisms for timeouts and recurring tasks.

finagle-netty4/src/main/scala/com/twitter/finagle/netty4/util · high confidence

Introduction of finagle-serversets module with ServerSet2 implementation

The finagle-serversets module is introduced, providing the ServerSet2 implementation for ZooKeeper-based service discovery. This includes the Zk2Resolver for resolving service endpoints, the ZkAnnouncer for registering service instances, and support for custom metadata and identities via service loading. The module also includes Java utilities for ZooKeeper client management, backoff strategies, and dynamic host set monitoring, along with Scala components for epoch-based stabilization and retry streams.

finagle-serversets · high confidence

Java API for FailureDetector configuration constants

A new Java utility class, FailureDetectors, has been added to the finagle-core liveness package to provide Java callers with access to FailureDetector configuration constants. This class exposes static fields for the global flag configuration and null configuration, bridging the gap between the Scala-based FailureDetector companion object and Java consumers.

finagle-core/src/main/java/com/twitter/finagle/liveness · high confidence

Java APIs for response classification and retry budgets

Added Java-friendly static utility classes to expose Finagle's response classification and retry budgeting capabilities. ResponseClasses provides constants for mapping responses to Success, NonRetryableFailure, RetryableFailure, and Ignored states, while RetryBudgets exposes factory methods to create Empty, Infinite, or custom RetryBudget instances with configurable TTL, minimum retries per second, and retry percentage.

finagle-core/src/main/java/com/twitter/finagle/service · high confidence

Java support for finagle-thrift tracing and client ID data structures

The finagle-thrift module now includes Java source files and build definitions for core Thrift data structures used in distributed tracing and client identification. This adds generated Java classes for Zipkin-style annotations (Annotation, BinaryAnnotation, Endpoint), ClientId, and ConnectionOptions, enabling Java-based Finagle services to properly serialize and deserialize these protocol-level fields for tracing and client bookkeeping.

finagle-thrift · high confidence

Java-compatible SSL configuration APIs added to Finagle

Finagle now provides dedicated Java-friendly wrapper classes for its SSL configuration options, located in the \com.twitter.finagle.ssl\ package. Users can now configure TLS settings using standard Java types without needing to interact with Scala-specific APIs. The new \ApplicationProtocolsConfig\, \CipherSuitesConfig\, \ProtocolsConfig\, and \ClientAuthConfig\ classes expose constants and factory methods for setting application protocols, cipher suites, TLS protocols, and client authentication modes. Additionally, \KeyCredentialsConfig\ and \TrustCredentialsConfig\ allow Java users to specify key and trust material using \java.io.File\ objects or standard \javax.net.ssl\ factories (\KeyManagerFactory\ and \TrustManagerFactory\). The \OpportunisticTlsConfig\ class exposes levels for opportunistic TLS. These changes improve interoperability for Java-based Finagle clients and servers.

finagle-core/src/main/java/com/twitter/finagle/ssl · high confidence

Memcached client now supports LZ4 compression

The finagle-memcached library now includes a compression feature using the LZ4 algorithm. Users can configure this by applying the \withCompressionScheme\ method to their client stack. Please note that this compression client does not support the \append\, \prepend\, or \replace\ memcached operations.

finagle-memcached · high confidence

New BufEncoder for Netty4 channel encoding

A new BufEncoder has been added to the finagle-netty4 module to handle encoding of Finagle Bufs into Netty ByteBufs. This sharable outbound handler delegates write operations to the existing BufCodec, providing a standardized way to serialize data for network transmission within the Netty4 transport layer.

finagle-netty4/src/main/scala/com/twitter/finagle/netty4/encoder · high confidence

New FinagleInit module for pre-bootstrap initialization

A new \finagle-init\ module has been introduced to provide a mechanism for running initialization code before Finagle bootstraps resources like its scheduler. The module defines a \FinagleInit\ trait that allows users to register initialization logic, which is guaranteed to run exactly once and before any Finagle clients or servers connect or accept connections, though no relative ordering is guaranteed between multiple init modules.

finagle-init/src · high confidence

New HTTP filters for response headers, client nack handling, and streaming metrics

This change introduces several new HTTP filters to the finagle-http module. The AddResponseHeadersFilter allows users to programmatically append a map of headers to outgoing responses. The ClientNackFilter converts HTTP nack responses into Failures, specifically handling chunked requests by stripping the retryable flag to prevent unsafe retries. The StreamingStatsFilter adds detailed metrics for HTTP streaming requests and responses, including duration, open/closed counts, and failure rates. Additionally, the PayloadSizeFilter now measures payload sizes for streaming messages in addition to buffered ones, and the LoggingFilter has been optimized to avoid unnecessary StringBuilder allocations during log escaping.

finagle-http/src/main/scala/com/twitter/finagle/http/filter · high confidence

New Java compatibility classes for FailureFlags and Stack parameters

Added Java-friendly wrapper classes to expose Finagle internals to Java callers. JavaFailureFlags provides static constants and methods to inspect failure flags on exceptions, while Stacks exposes an EMPTY\_PARAMS constant for creating empty parameter maps, bridging Scala-only APIs to Java code.

finagle-core/src/main/java/com/twitter/finagle · high confidence

New Netty 4 SSL client engine factories and verification handler

This location introduces the core components for Finagle's Netty 4 SSL client implementation. It adds \Netty4ClientEngineFactory\ as the standard factory for creating SSL engines using Netty's \SslContextBuilder\, supporting both JDK and native (OpenSSL) providers via a \forceJdk\ flag. It also provides \ExternalClientEngineFactory\ for simplified, high-performance client connections to external servers by caching SSL contexts and ignoring certain configuration parameters like cipher suites. A \ReloadingNetty4ClientEngineFactory\ is included to automatically refresh SSL contexts at configurable intervals. Finally, \SslClientVerificationHandler\ ensures that the connection promise is only satisfied after the SSL/TLS handshake completes and session verification succeeds, preventing race conditions during connection establishment.

finagle-netty4/src/main/scala/com/twitter/finagle/netty4/ssl/client · high confidence

New finagle-mysql client with prepared statements, transactions, and tracing

The finagle-mysql module introduces a new, non-Service-based MySQL client API that simplifies database interactions. Users can now execute queries via \read\, \modify\, and \select\ methods, and leverage type-safe prepared statements with implicit parameter conversion for Scala and explicit conversion for Java. The client supports SQL transactions with isolation level configuration, connection initialization SQL, and detailed distributed tracing that extracts table names and query verbs. Authentication is enhanced with support for \caching\_sha2\_password\ and RSA public key encryption, while binary row decoding and charset handling are updated for MySQL 8 compatibility.

finagle-mysql/src/main/scala/com/twitter/finagle/mysql · high confidence

New memcached client capabilities: LZ4 compression, read repair, and twemcache support

The finagle-memcached client now supports several advanced features for improved performance and reliability. Users can enable automatic LZ4 compression for stored values via the new CompressingMemcachedFilter, which compresses storage commands and decompresses retrieval responses. A PoolingReadRepairClient is introduced to support replicated memcached setups, allowing clients to detect and repair inconsistent data across nodes during reads. Additionally, the client now supports twemcache-specific commands (getv and upsert) via the TwemcacheClient interface, and includes a ZookeeperStateMonitor to handle dynamic cluster membership changes based on Zookeeper node events.

finagle-memcached/src/main/scala/com/twitter/finagle/memcached · high confidence

Ruby tracing library integrated with Zipkin and B3

The finagle-thrift Ruby gem now includes a new tracing implementation that integrates with Zipkin and supports B3 propagation headers. This change introduces thread-local trace stacks to ensure correct context isolation across concurrent requests, adds support for 128-bit trace IDs, and implements a debug flag that forces traces to be stored for easier development and debugging. The library also handles proper span, parent, and trace ID generation, including padding hex digits and managing cases where the Ruby service is the first in a trace.

ruby · high confidence

Architecture

Added Bazel build configuration for finagle-mux

The finagle-mux module now includes a BUILD file that defines targets for building the main source code and running tests, tagged as bazel-compatible. This change enables the module to be compiled and tested using the Bazel build system, aligning it with the broader migration of the finagle codebase to Bazel. Additionally, a PROJECT file was added to specify the owners of this module.

finagle-core, finagle-mux · high confidence

Finagle core package structure reorganization

The \finagle-core\ source tree has been reorganized into a new package structure under \com.twitter.finagle\. This change introduces a new \com/package.scala\ file and moves core implementation files (such as \Service.scala\, \Filter.scala\, and \Stack.scala\) into their respective sub-packages (e.g., \com.twitter.finagle.service\, \com.twitter.finagle.filter\, \com.twitter.finagle.stack\). This structural shift aligns the codebase with the new modular architecture, separating concerns like load balancing, tracing, and transport into distinct namespaces while maintaining the public API surface.

finagle-core/src/main/scala · high confidence

Behavioural changes

Add Bazel build and project metadata for finagle-integration tests

The finagle-integration module now includes a BUILD.bazel file that defines a test suite aggregating Scala integration tests for various finagle protocols (mux, http, mysql, memcache), along with PROJECT and README files to establish ownership and documentation. This change enables the integration tests to be built and run using the Bazel build system.

finagle-integration · high confidence

Add netty3/netty4 toggle support for finagle-mysql

The finagle-mysql module now includes a toggle mechanism to switch between Netty 3 and Netty 4 implementations. A new \package.scala\ file defines a \Toggles\ variable using \StandardToggleMap\, enabling runtime configuration of the underlying network library.

finagle-mysql/src/main/scala/com/twitter/finagle · high confidence

Add toggle infrastructure for finagle-memcached

A new package object is introduced in the finagle-memcached module to define a dedicated ToggleMap. This provides the underlying infrastructure for feature toggles, specifically enabling the controlled activation of Netty 4 as indicated by the associated commit context, without changing the default behavior.

finagle-memcached/src/main/scala/com/twitter/finagle · medium confidence

Bazel build configuration added for finagle-http

A new BUILD file has been introduced for the finagle-http module, defining a \target\ for the main Scala source and a \test\_suite\ for Java and Scala tests, both tagged as \bazel-compatible\. Additionally, a PROJECT file has been created to specify ownership and watch lists for the module, including specific file-level security ownership for SpnegoAuthenticator.scala.

finagle-http · high confidence

Bazel build configuration for benchmark resources

The benchmark module now includes a Bazel build file (BUILD.bazel) that explicitly defines how resource files, such as the newly added real\_latencies.data, are packaged. This change ensures that these resources are correctly included in the build artifacts for users relying on the Bazel build system, while excluding irrelevant files like Python bytecode.

finagle-benchmark/src/main/resources · high confidence

Documentation code examples updated for Netty 4 and SBT 1.3.10

The 'Client/Server Anatomy' documentation now includes code examples demonstrating how to build Netty pipelines using both Netty 3 and Netty 4 APIs, alongside a portable SBT launcher script configured for version 1.3.10. This allows users to follow the tutorial with modern Netty 4 dependencies while ensuring the build tooling is correctly set up.

doc/src/sphinx/code/client-server-anatomy · high confidence

Documentation styling and architecture diagrams updated

The documentation site now uses a new Bootstrap-based theme with custom typography and layout adjustments, replacing the previous styling. Additionally, the client and server stack diagrams have been replaced with new, clearer SVG illustrations to better visualize the Finagle architecture.

_doc/src/sphinx/\static · high confidence

Finagle Mux protocol layer introduces compression, opportunistic TLS, and application header encapsulation

The finagle-mux module has been refactored to support a richer multiplexing protocol. Clients and servers can now configure compression preferences (enabling/disabling and selecting compressors) via the new \CompressionParams\ API. Opportunistic TLS is supported, allowing connections to negotiate encryption levels (Off, Desired, Required) during a cleartext handshake, with a toggle to enable TLS snooping by default. Application headers are now encapsulated within mux context entries to isolate them from broadcast contexts, with automatic culling if they exceed the protocol's length limits. The module also introduces a formal handshake mechanism, generic request context support, and lease support for client-side session management.

finagle-mux/src/main/scala/com/twitter/finagle/mux · high confidence

Finagle adopts a stack-based architecture with new MethodBuilder APIs

Finagle has been refactored to use a new stack-based architecture, replacing the legacy ClientBuilder and ServerBuilder with StackClient and StackServer. This change introduces the MethodBuilder API, which provides a unified, type-safe way to configure clients and servers across all protocols (HTTP, Thrift, Redis, MySQL, etc.) using composable filters and stack parameters. The new architecture enables better modularity, allowing users to insert, remove, or reorder filters (such as TimeoutFilter, RetryFilter, and AdmissionControl) with greater precision. Legacy APIs are deprecated in favor of the new stack-based builders, and many internal components like FailureAccrualFactory and LoadBalancerFactory have been updated to integrate with the new stack model.

repository · high confidence

Finagle landing page now includes Google Analytics tracking

The Finagle website's main landing page (site/index.html) now includes the Google Analytics tracking script (UA-39101739-4), enabling the collection of usage metrics for visitors. The page also serves as the central hub linking to the user guide, developer guide, API documentation, and various companion projects like Finatra, Finch, and Fintop.

site · high confidence

Finagle stats module split and Bazel migration

The finagle-stats module has been split out into its own directory and migrated to Bazel, introducing a new build structure with explicit dependencies on finagle-core, finagle-stats-core, and util-stats. This change includes the addition of service provider files for HttpMuxHandler, HostStatsReceiver, SchemaRegistry, and StatsReceiver, which register MetricsExporter, PrometheusExporterHandler, HostMetricsExporter, MetricsHostStatsReceiver, and MetricsStatsReceiver. The module now uses a forced scope for its Scala library to accommodate both runtime and compile-time consumers, and includes a dummy stats class to satisfy Bazel requirements.

finagle-stats · high confidence

Finagle tunables now load from per-environment and per-instance JSON files

The \StandardTunableMap\ in \finagle-tunable\ has been updated to compose configuration from three sources: in-memory mutable maps, service-loaded maps, and JSON files. The JSON layer now supports granular configuration by loading files based on the server's environment and instance ID, with a specific priority order (environment+instance \> environment \> instance \> all instances). This allows users to override tunable values via JSON files located in paths like \com/twitter/tunables/{id}/{environment}/instance-{id}.json\ or \com/twitter/tunables/{id}/{environment}/instances.json\, providing more flexible, context-aware configuration management.

finagle-tunable · high confidence

HTTP codec implementation migrated to Netty4

The HTTP codec utilities in finagle-http now delegate all request and response encoding and decoding operations to the Netty4-based implementation (Netty4HttpCodec). This change ensures that HTTP message serialization and deserialization are handled by the Netty4 transport layer, aligning the codec behavior with the Netty4 backend.

finagle-http/src/main/scala/com/twitter/finagle/http/codec · high confidence

HTTP/2 NACK handling now uses RST frames instead of exceptions

The HTTP/2 transport layer has been refactored to handle NACK (negative acknowledgment) responses by sending HTTP/2 RST\_STREAM frames rather than throwing RstExceptions. This change introduces new handlers (Http2NackHandler, H2StreamChannelInit) that convert internal nack headers into appropriate RST frames (REFUSED\_STREAM for retryable, ENHANCE\_YOUR\_CALM for non-retryable) and updates the client-side message handling to synthesize 503 responses for these cases instead of failing with exceptions. This provides a more standard HTTP/2 compliant way to signal stream-level errors and nacks.

finagle-http2/src/main/scala/com/twitter/finagle/http2/transport/common · high confidence

HTTP/2 server implementation refactored with new pipeline and exception tracking

The HTTP/2 server implementation in finagle-http2 has been significantly restructured to improve observability and pipeline management. A new \ExceptionTrackingFrameListener\ now wraps the HTTP/2 frame listener to count and expose session and stream exceptions via stats, controlled by the \trackH2SessionExceptions\ flag. The server pipeline initialization is consolidated into dedicated initializers (\Http2CleartextServerInitializer\ and \Http2TlsServerInitializer\) that handle protocol upgrades and TLS ALPN negotiation, while \Http2PipelineInitializer\ manages the insertion of the \H2ServerFilter\ and cleanup of dead handlers. Additionally, new exception classes (\GoAwayException\, \RstException\, \DeadConnectionException\) provide more detailed context for stream and connection failures, and \MultiplexHandlerBuilder\ centralizes the construction of HTTP/2 frame codecs with support for per-frame-type logging and stream gauges.

finagle-http2/src/main/scala/com/twitter/finagle/http2 · high confidence

HTTP/2 server pipeline refactored with dedicated handlers for connection management and protocol negotiation

The HTTP/2 server transport layer has been restructured into distinct pipeline components to improve connection lifecycle management and protocol negotiation. A new H2ServerFilter now centralizes session handling, including graceful shutdown logic that sends GOAWAY frames and manages stream draining, while ensuring channels are closed only once. Protocol negotiation is split into two new handlers: PriorKnowledgeHandler detects the HTTP/2 client preface for immediate cleartext upgrades, and ServerNpnOrAlpnHandler handles TLS-based ALPN/NPN negotiation. Additionally, H2UriValidatorHandler was added to validate URIs in HTTP/2 headers, ensuring consistent 400 Bad Request responses for invalid paths across both HTTP/1.1 and HTTP/2 implementations.

finagle-http2/src/main/scala/com/twitter/finagle/http2/transport/server · high confidence

Introduces BufCodec for optimized ByteBuf-to-Buf conversion

A new BufCodec handler and pipeline configuration have been added to the netty4 codec module. This change replaces previous ByteBuf-to-Buf conversion mechanisms with a handler that directly writes composite and direct Buffers to off-heap ByteBufs, eliminating intermediate on-heap copies and reducing memory pressure by preventing heap-backed buffers from being tenured. The BufCodecPipeline utility simplifies installing this handler into Netty channel pipelines.

finagle-netty4/src/main/scala/com/twitter/finagle/netty4/codec · high confidence

Ketama consistent hashing partitioning for Memcached

The Memcached client now uses Ketama consistent hashing to route requests to specific nodes, replacing the previous routing logic. This change enables more efficient distribution of keys across the cluster and supports partial success for batch operations (such as get/getv/gets), where individual key failures are reported alongside successful results rather than failing the entire batch.

finagle-memcached/src/main/scala/com/twitter/finagle/memcached/partitioning · high confidence

Memcached protocol error handling and expiry validation

The memcached protocol layer now includes specific exception classes for decoding failures (NonexistentCommand) and general client/server errors, improving error categorization. Additionally, a new ExpiryValidation utility checks command expiry times, logging negative expiry values at the TRACE level to help diagnose timing issues without cluttering standard logs.

finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol · high confidence

Mux transport layer refactored with Netty4 framer and opportunistic TLS support

The mux transport implementation has been updated to use a new Netty4-based framer (Netty4Framer) for handling frame encoding and decoding, replacing previous mechanisms. Additionally, the transport now supports opportunistic TLS negotiation via the OpportunisticTls module, which allows clients and servers to agree on encryption levels (Off, Desired, Required) during session initialization, throwing an IncompatibleNegotiationException if requirements cannot be met. The MuxFramer object provides header encoding/decoding for frame size and TLS level negotiation.

finagle-mux/src/main/scala/com/twitter/finagle/mux/transport · high confidence

New HTTP/2 client transport implementation

The HTTP/2 client transport layer has been rewritten to use a new multiplexed session model. This introduces dedicated components for managing HTTP/2 sessions (ClientSession), handling connection upgrades from HTTP/1.1 (H2CTransporter, UpgradeRequestHandler), and managing TLS-based HTTP/2 connections (TlsTransporter). The implementation adds support for per-session request limits, backpressure configuration, and a fix for a race condition during SSL handshakes (DelayByteBufHandler). Users benefit from a more robust and performant HTTP/2 client that properly handles stream multiplexing and connection lifecycle management.

finagle-http2/src/main/scala/com/twitter/finagle/http2/transport/client · high confidence

New Netty 4 SSL server engine factory with service identifier tracking and context reloading

Finagle on Netty 4 now uses a new \Netty4ServerEngineFactory\ for server-side TLS, replacing the previous default with a factory that supports both JDK and native (OpenSSL) providers via a \forceJdk\ flag. This change introduces \ReloadingNetty4ServerEngineFactory\ to automatically refresh SSL contexts at configurable intervals, and enhances mTLS observability by wrapping trust managers to capture client service identifiers from certificates even when validation fails, allowing failed handshake metrics to be attributed to specific services.

finagle-netty4/src/main/scala/com/twitter/finagle/netty4/ssl/server · high confidence

Ref-counted SSL engines and automatic context reloading

The Netty 4 SSL implementation now uses ref-counted OpenSSL contexts by default, which reduces garbage collection overhead by cleaning up individual SSLEngines via reference counting rather than relying on finalizers. To support dynamic certificate management, a new ContextReloader asynchronously refreshes the SslContext at configurable intervals, ensuring that updated certificates are picked up without restarting the service. Additionally, a custom Netty4SslHandler now tracks handshake latency metrics, providing better observability into TLS connection performance.

finagle-netty4/src/main/scala/com/twitter/finagle/netty4/ssl · high confidence

Refactor HTTP model to decouple from Netty 3 and support Scala 2.13

The HTTP model in finagle-base-http has been refactored to remove dependencies on Netty 3 types and adapt to Scala 2.13 collection changes. This introduces version-specific implementations for CookieMap, ParamMap, and HeaderMap to handle API differences between Scala 2.12 and 2.13, while also introducing a new CookieCodec abstraction to allow swapping cookie encoding/decoding logic. Additionally, core HTTP components like Cookie, HeaderMap, and Message are now defined in this module, decoupling the base HTTP semantics from the underlying Netty transport.

finagle-base-http/src/main/scala · high confidence

Refactor Memcached transport layer to use Netty4 pipeline components

The Memcached protocol's transport layer has been refactored to integrate directly with Netty4's channel pipeline architecture. For the server side, encoding and decoding are now handled by adding \BufCodec\ and a \DecoderHandler\ wrapping the \ServerFramer\ to the pipeline. For the client side, a new \Netty4ClientPipelineInit\ abstract class and its concrete \MemcachedNetty4ClientPipelineInit\ implementation manage the pipeline by adding a \BufEncoder\, a \MessageEncoderHandler\ for commands, and a \ByteReaderDecoderHandler\ wrapping the \FramingDecoder\ for responses. This change centralizes the Netty4-specific pipeline configuration within the \transport\ package, replacing previous ad-hoc or separate encoding/decoding logic with a structured pipeline initialization approach.

finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/transport · high confidence

Refactored Memcached server protocol handling into dedicated server-side components

The memcached server's text protocol implementation has been restructured to separate server-specific encoding and decoding logic from client-side concerns. This change introduces new server-specific components: \MemcachedServerDecoder\ for parsing incoming commands, \ResponseToBuf\ for encoding server responses, \ServerFramer\ for handling data length calculation, and \ServerTransport\ to wire these together. Additionally, \ExceptionHandler\ was added to standardize error message formatting. This refactoring ensures that server-side behavior is isolated, improving maintainability and clarity of the protocol stack.

finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/server · high confidence

Refactored Memcached text protocol encoding and decoding pipeline

The text protocol implementation in finagle-memcached has been restructured to move encoding and decoding logic directly into the Netty channel pipeline. This change introduces new components such as \ByteReaderDecoderHandler\ and \MessageEncoderHandler\ to manage the conversion between raw bytes and protocol objects, while replacing the previous \Decoder\ trait with a \FramingDecoder\ and \FrameDecoder\ architecture that handles byte reading and frame extraction more efficiently. Client-side command encoding is now handled by \CommandToBuf\ which implements the new \MessageEncoder\ interface, ensuring that all serialization and deserialization for the Memcached text protocol is performed within the pipeline handlers rather than in separate workflow stages.

finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text · high confidence

Refactored Netty4 channel pipeline initialization and statistics handling

The Netty4 transport layer has been restructured to improve pipeline modularity and reliability. Channel initialization is now handled by dedicated initializers (e.g., \Netty4ClientChannelInitializer\, \Netty4RawServerChannelInitializer\) that explicitly manage the order of handlers for timeouts, SSL/TLS, and proxies. A new \BufferingChannelOutboundHandler\ trait ensures outbound writes are queued and not lost while connections are being established or handshakes are pending. Statistics tracking has been refined: \ChannelStatsHandler\ and \ChannelRequestStatsHandler\ now use shared state to aggregate metrics across channels, and \ChannelExceptionHandler\ provides consistent wrapping and logging of timeouts and other exceptions. Additionally, proxy support (HTTP and SOCKS5) is integrated directly into the client pipeline with proper timeout delegation to Finagle.

finagle-netty4/src/main/scala/com/twitter/finagle/netty4/channel · high confidence

Register Netty 4-specific Finagle components via Java ServiceLoader

The finagle-netty4 module now registers its specific implementations for initialization, DNS resolution, and timer execution using Java ServiceLoader configuration files. This ensures that Netty 4-specific classes (Netty4Init, Netty4InetResolver, FixedNetty4InetResolver, and Netty4HashedWheelTimer) are automatically discovered and used when the finagle-netty4 library is on the classpath, replacing any default or other implementations.

finagle-netty4/src/main/resources/META-INF · high confidence

Updated Finagle Quickstart code samples and build tooling

The Finagle quickstart documentation now includes fresh Scala code examples for creating HTTP clients, servers, and proxies, demonstrating the use of \com.twitter.finagle.Http\ to build services and handle requests. Additionally, the project's build configuration has been updated to use sbt version 1.3.10, including a new launcher script that downloads the specific sbt jar with SHA-1 verification to ensure reproducible builds.

doc/src/sphinx/code/quickstart · high confidence

Updated HTTP client and server examples to use modern Finagle APIs

The HTTP example code in \finagle-example\ has been rewritten to demonstrate current Finagle patterns. The server example now uses \Http.server.withStreaming\ and composes \SimpleFilter\s for exception handling and authorization, while the client example demonstrates error handling via filters and parallel request execution. New streaming examples (\HttpStreamingClient\ and \HttpStreamingServer\) showcase chunked transfer encoding using \AsyncStream\ and \Pipe\, replacing older codec-based approaches.

finagle-example/src/main/scala/com/twitter/finagle/example/http · high confidence

Updated Netty 4 client-server anatomy documentation examples

The documentation for the client-server anatomy has been updated to reflect the current Netty 4 transport implementation. The new \Echo.scala\ example demonstrates how to construct clients and servers using \Netty4Transporter\ and \Netty4Listener\, showing the integration of standard filters like retry, timeout, and mask-cancel, as well as explicit bridge patterns for manual transport management.

client-server-anatomy · high confidence

Updated Thrift example to use MethodPerEndpoint API

The Thrift client and server examples in the finagle-example module have been migrated to the new MethodPerEndpoint API, replacing the older FutureIface and HKT patterns. Users can now see how to build clients and serve interfaces using the modern, simpler service-per-endpoint style, including examples of applying filters and retry policies to individual methods.

finagle-example/src/main/scala/com/twitter/finagle/example/thrift · high confidence

finagle-mysql is promoted to stable and made Bazel-compatible

The finagle-mysql module is promoted out of the experimental directory to become a stable, first-class component. To support this, a new Bazel BUILD file is introduced to define the library and its test suites, ensuring the module is now buildable with Bazel. Additionally, project ownership is explicitly defined in a new PROJECT file, and the README is updated with clearer documentation on the driver's capabilities, including prepared statements and transactions.

finagle-mysql · high confidence

Test coverage

Add Bazel build file for test resources; Add JMH benchmarks for Finagle components and load balancer simulation; Add integration tests for finagle-redis; Add test resources for swimming record schema and data; Added Bazel build rules and compilation tests for HTTP tracing; Added Java API compilation tests for Finagle HTTP client and server; Added Java compatibility compilation tests for context APIs; Added Java compilation test for StatsScoping; Added Java compilation tests for Finagle core APIs; Added Java compilation tests for Finagle service components; Added Java compilation tests for Mux stack parameters and API usage; Added Java compilation tests for MySQL client APIs; Added Java compilation tests for SSL configuration classes; Added Java unit tests for StatsReceiver implementations; Added SSL test certificates and keys for Finagle core tests; Added SSL test certificates and keys for finagle-netty4; Added SSL/TLS test certificates and keys; Added compilation test for ClientBuilder.configured API; Added compilation test for HTTP/2 StackParam API; Added compilation test for Params API; Added compilation test for Request creation with payload; Added compilation tests for HTTP service classifiers and method builder; Added compilation tests for Http.Server and Http.Client withStack methods; Added compilation tests for HttpMuxer and Request; Added compilation tests for load balancer registry and factory APIs; Added compilation tests for trace service name and trace ID accessors; Added comprehensive test coverage for Finagle client components; Added comprehensive test coverage for finagle-base-http HTTP model components; Added comprehensive test coverage for finagle-mux; Added integration tests for Finagle Memcached client; Added integration tests for Status.busy propagation; Added test SSL certificates and keys for Finagle HTTP; Added test coverage for Finagle connection pool implementations; Added test coverage for HTTP filters in finagle-http; Added test coverage for HTTP/2 listener, pipeline, transport, and settings; Added test coverage for HeaderMap implementations and RFC 7230 validation; Added test coverage for Netty4 channel handlers and initialization; Added test for finagle-core build properties loading; Added test infrastructure for external Memcached integration; Added test resources for Ketama consistency hashing; Added test resources for MySQL authentication; Added test resources for external broadcast context loading; Added test service provider configuration for HTTP context loading; Added test service provider configurations for Finagle components; Added test utilities for push session components; Added test utilities for string-based client implementations; Added tests for Aperture load balancer components; Added tests for BufCodec and BufCodecPipeline; Added tests for ChannelTransport and ChannelTransportContext; Added tests for ClientBuilder, End-to-End, and ServerChannelConfiguration; Added tests for EventLoopGroupTracker thread monitoring; Added tests for Finagle context propagation and management; Added tests for Finagle naming components; Added tests for Finagle scheduler initialization and forking behavior; Added tests for Finagle server lifecycle, connection tracking, and transport utilities; Added tests for Finagle stats receivers and dimensional metrics; Added tests for HTTP client connection handling, response classification, and path routing; Added tests for HTTP client/server configuration and TLS snooping; Added tests for HTTP codec dispatchers and encoding; Added tests for HTTP context serialization and header handling; Added tests for HTTP filter context, Dtab, and nack handling; Added tests for HTTP path parsing and extraction logic; Added tests for HTTP/2 peer certificate availability; Added tests for HTTP/2 stream message handling and header stripping; Added tests for LengthFieldFramer decoder behavior; Added tests for MuxCancelledCategorizer; Added tests for Netty 4 SSL client engine factories and channel initializers; Added tests for Netty 4 SSL server engine factories and handlers; Added tests for Netty 4 cookie encoding and decoding; Added tests for Netty4Timer; Added tests for OffloadFilter admission control and queue sampling; Added tests for P2C and Round Robin load balancers; Added tests for RecordSchema behavior; Added tests for SSL context reloading and TLS connection gauges; Added tests for SSL server engine factories and configuration; Added tests for SSL session info and service identity extraction; Added tests for SSL/TLS configuration and security components; Added tests for ServiceFactoryCache, StatsFactoryWrapper, and TimeoutFactory; Added tests for StabilizingAddr health-aware stabilization logic; Added tests for StatsTransport and Transport functionality; Added tests for TagMap and TagSet utilities; Added tests for Zstd streaming decompression in Finagle Netty4; Added tests for experimental HTTP routing components; Added tests for finagle-mux lease experimental components; Added tests for gRPC Context Storage override; Added tests for liveness detection and failure accrual policies; Added tests for mux transport layer components; Added tests for push session pipeline and server lifecycle; Added tests for the Netty4 DecoderHandler; Added tests for the experimental RoutingService; Added tests for the experimental fiber scheduler and concurrency limit filter; Added tests for transport TLS parameter configuration and Tags utility; Added unit and integration tests for Netty4 push session components; Added unit tests for HTTP and Netty4 proxy connect handlers; Added unit tests for HTTP utility functions; Added unit tests for HTTP/2 client transport components; Added unit tests for HTTP/2 server transport handlers; Added unit tests for Memcached server protocol decoding and response encoding; Added unit tests for Memcached text protocol client decoding; Added unit tests for Memcached text protocol decoders and framers; Added unit tests for Memcached utility classes; Added unit tests for MemcachedPartitioningService; Added unit tests for MySQL transport buffer and packet handling; Added unit tests for PipeliningDispatcher and SerialServerDispatcher; Added unit tests for finagle-core utility classes; Added unit tests for finagle-memcached client and compression features; Added unit tests for finagle-mysql core components; Added unit tests for load balancer components; Added unit tests for memcached key and expiry validation; Added unit tests for the heap-based least-loaded load balancer; Added unit tests for the new push-session Mux implementation; Expanded end-to-end test coverage for Finagle HTTP client and server configurations; New embedded MySQL test harness for integration testing; New integration test suite for Finagle protocols; New integration test suite for Finagle-MySQL; Updated test certificates for SSL testing; finagle-postgresql: Initial integration test infrastructure with Docker-backed PostgreSQL and CockroachDB.

Dependencies

Migrate build system to SBT 1.7.1 and modernize plugin configuration

The project has upgraded its build tool from SBT 0.7.4 to version 1.7.1, as defined in \project/build.properties\. This migration involves replacing the legacy \Project.scala\ build definition with a modern plugin-based structure using \project/plugins.sbt\ and \project/unidoc.sbt\. The new configuration adds the Scrooge SBT plugin (version 24.8.0-SNAPSHOT), sbt-site (1.4.1), sbt-jmh (0.4.3), and sbt-unidoc (0.5.0), while removing the old hardcoded dependency definitions for Netty, Util, Mockito, and Specs.

project · high confidence

Upgrade to Netty 4.1.100 and Jackson 2.14.3

The Finagle build configuration has been updated to use Netty 4.1.100.Final, including the static SSL library netty-tcnative-boringssl-static 2.0.61.Final, and Jackson 2.14.3. This brings the project up to date with the latest stable versions of these core networking and serialization libraries, ensuring compatibility with modern JVM features and security patches.

(dependencies) · high confidence

Upgrade to Netty 4.1.39.Final

Finagle has upgraded its underlying Netty transport library to version 4.1.39.Final. This update brings performance improvements, bug fixes, and security patches from the Netty project to all Finagle services relying on the Netty 4 transport layer.

(repo-wide) · high confidence

Housekeeping

New Finagle User Guide documentation

The Sphinx documentation source has been significantly expanded with new and updated guides covering core Finagle concepts. This includes detailed documentation for Aperture Load Balancers (including eager connections), Client and Server configuration (migrating from ClientBuilder to the Finagle 6 Stack API and MethodBuilder), Compression (HTTP and ThriftMux), Contexts (local and broadcast), and Feature Toggles. Additionally, new sections have been added for Flags, Futures (concurrent programming and synchronization), Glossary, and a comprehensive FAQ addressing cancellation, retry storms, and configuration changes.

doc/src/sphinx · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 40 → 75 (+34.1)
  • Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 91 → 92 (+1.2)
  • Architecture 94 → 93 (-0.8)
  • Maturity 44 → 68 (+23.7)
  • Readiness 23 → 73 (+50.0)
  • Security 49 → 85 (+36.1)

Resolved (35)

  • Coverage not measured — test suite did not build
  • Dimension evaluation failed
  • Duplicated block (21 lines × 2) (finagle-thrift/src/main/java/com/twitter/finagle/thrift/thrift/RequestContext.java)
  • Duplicated block (6 lines × 2) (finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/Group.java)
  • Duplicated block (6 lines × 2) (finagle-thrift/src/main/java/com/twitter/finagle/thrift/thrift/RequestHeader.java)
  • Duplicated block (6 lines × 2) (finagle-thrift/src/main/java/com/twitter/finagle/thrift/thrift/ResponseHeader.java)
  • Duplicated block (6 lines × 2) (finagle-thrift/src/main/java/com/twitter/finagle/thrift/thrift/ResponseHeader.java)
  • Duplicated block (6 lines × 2) (finagle-thrift/src/main/java/com/twitter/finagle/thrift/thrift/Span.java)
  • Duplicated block (6 lines × 3) (finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/Group.java)
  • Duplicated block (69 lines × 2) (finagle-serversets/src/main/java/com/twitter/finagle/common/zookeeper/Group.java)
  • Duplicated block (9 lines × 2) (finagle-thrift/src/main/java/com/twitter/finagle/thrift/thrift/RequestHeader.java)
  • Duplicated block (9 lines × 2) (finagle-thrift/src/main/java/com/twitter/finagle/thrift/thrift/Span.java)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • …and 15 more

New (233)

  • AnnotatingTracingFilter.apply (cognitive 16) (finagle-core/src/main/scala/com/twitter/finagle/tracing/TraceInitializerFilter.scala)
  • AuthNegotiation.step (cognitive 16) (finagle-mysql/src/main/scala/com/twitter/finagle/mysql/AuthNegotiation.scala)
  • AuthNegotiation.step (cyclomatic 18) (finagle-mysql/src/main/scala/com/twitter/finagle/mysql/AuthNegotiation.scala)
  • Change coupling: EndpointerStackClient.scala ↔ ListeningStackServer.scala (finagle-core/src/main/scala/com/twitter/finagle/client/EndpointerStackClient.scala)
  • ClientDecoder.decodeData (cognitive 22) (finagle-memcached/src/main/scala/com/twitter/finagle/memcached/protocol/text/client/ClientDecoder.scala)
  • ClientDispatcher.decodePacket (cognitive 25) (finagle-mysql/src/main/scala/com/twitter/finagle/mysql/ClientDispatcher.scala)
  • ClientTraceAnnotationsFilter.module (cognitive 18) (finagle-thriftmux/src/main/scala/com/twitter/finagle/thriftmux/service/ClientTraceAnnotationsFilter.scala)
  • Concentrated knowledge decay
  • Duplicated block (10 lines × 2) (finagle-memcached/src/main/scala/com/twitter/finagle/memcached/Client.scala)
  • Duplicated block (10 lines × 2) (finagle-thriftmux/src/main/scala/com/twitter/finagle/thriftmux/service/ThriftMuxResponseClassifier.scala)
  • Duplicated block (10 lines × 3) (finagle-core/src/main/scala/com/twitter/finagle/tracing/TraceInitializerFilter.scala)
  • Duplicated block (10 lines × 4) (finagle-memcached/src/main/scala/com/twitter/finagle/memcached/Client.scala)
  • Duplicated block (11 lines × 2) (finagle-core/src/main/scala/com/twitter/finagle/tracing/TraceInitializerFilter.scala)
  • Duplicated block (11 lines × 2) (finagle-stats-core/src/main/scala/com/twitter/finagle/stats/MetricsStatsReceiver.scala)
  • Duplicated block (13 lines × 2) (finagle-mysql/src/main/scala/com/twitter/finagle/mysql/PlainHandshake.scala)
  • Duplicated block (14 lines × 2) (finagle-thrift/src/main/scala/com/twitter/finagle/thrift/service/ThriftResponseClassifier.scala)
  • Duplicated block (14 lines × 2) (finagle-thriftmux/src/main/scala/com/twitter/finagle/thriftmux/service/ThriftMuxResponseClassifier.scala)
  • Duplicated block (15 lines × 2) (finagle-core/src/main/scala/com/twitter/finagle/loadbalancer/Balancers.scala)
  • Duplicated block (17 lines × 2) (finagle-base-http/src/main/scala/com/twitter/finagle/http/GenStreamingSerialServerDispatcher.scala)
  • Duplicated block (19 lines × 2) (finagle-core/src/main/scala/com/twitter/finagle/service/ExpiringService.scala)
  • …and 213 more

Changes since last survey

  • 1 commits — 1 feature/other, 0 fixes

By area

  • finagle-serversets/src — 1 commit

Notable commits

  • change: The test target "//finagle/finagle-serversets/src/test/scala:serversets" is failing too often in master in CI.

Architecture

  • Containers 0 added · 0 removed · contexts 3 added · 0 removed · edges 2 added · 0 removed

Added bounded contexts (3)

  • client-server-anatomy
  • repository
  • ruby

Added dependency edges (2)

  • client-server-anatomy → repository (coupling)
  • repository → client-server-anatomy (coupling)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

twitter/finagle was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 27 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit ca472deb355c7d3b8d7eb077223991e8c8f4ad8b — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-d00c643c3f66.