Finagle v6.40.0 Release Notes

  • ๐Ÿ†• New Features

    
    * finagle: Most libraries (excluding finagle-thrift{,mux}) no longer need to
      add an additional resolver that points to maven.twttr.com. ``RB_ID=878967``
    
    * finagle: Introducing a new Finagle module `finagle-base-http` that provides
      a common ground for both Netty 3 (`finagle-http`) and Netty 4 (`finagle-netty4-http`)
      HTTP implementations. Netty 3 is still a default transport used in Finagle's
      `Http.client` and `Http.server`. ```RB_ID=884614``
    
    * finagle-core: Introduce the `c.t.f.client.DynamicTimeout` module allowing clients
      to specify call-site specific timeouts. ``RB_ID=885005``
    
    * finagle-core: A new module, `c.t.f.service.DeadlineFilter`, can be added to stack-based servers
      and clients, which rejects requests with expired deadlines ``RB_ID=895820``
    
    * finagle-memcached: Introduce `c.t.f.memcached.CasResult.replaced: Boolean`
      to help transition usage off of the deprecated `cas` client method to
      `checkAndSet`. ``RB_ID=891628``
    
    * finagle-thrift: We now depend on a fork of libthrift hosted in the Central Repository.
      The new package lives in the 'com.twitter' organization. This removes the necessity of
      depending on maven.twttr.com. This also means that eviction will not be automatic and
      using a newer libthrift library requires manual eviction if artifacts are being pulled
      in transitively. ``RB_ID=885879``
    
    โš™ Runtime Behavior Changes
    
    • ๐ŸŒฒ finagle-core: Monitor logging is improved in Finagle. RB_ID=878890

      • All exceptions caught in the stack are now logged by Finagle's DefaultMonitor (previously Util's RootMonitor) such that Twitter's logging framework is used instead of JDK logging.
      • DefaultMonitor is now installed implicitly such that it will be composed (via orElse) with the monitor passed by a user through the stack param. The logic behind this compostion is quite straightforward: exceptions that are't handled by a user-defined monitor propagated to the default monitor.
      • DefaultMonitor now logs upstream socket address, downstream socket address, and a client/server label if those are available.
      • RootMonitor is still used to handle fatal exceptions from pending side-effect-only closures (i.e., onFailure, onSuccess) on a service future/promise.
    • ๐Ÿšš finagle-core: c.t.f.service.DeadlineStatsFilter has been removed from the server stack, along with all related stats. The "admission_control/deadline/transit_latency_ms" stat has been moved to c.t.f.filter.ServerStatsFilter and re-scoped as "transit_latency_ms" RB_ID=895820

    • finagle-mux: com.twitter.finagle.Failures are now sent over the wire with their flags intact via com.twitter.finagle.mux.transport.MuxFailure in the previously unused Rdispatch context. This allows for greater signaling along a chain of services. See the "MuxFailure Flags" section of the mux protocol spec in finagle-mux/src/main/scala/c/t/f/mux/package.scala RB_ID=882431

    • finagle-netty4: The netty4 listener + transporter no longer manage direct byte buffers by default. c.t.f.netty4.channel.DirectToHeapInboundHandler is introduced to help protocol builders manage them. RB_ID=881648

    • 0๏ธโƒฃ finagle-stats: Changed the default behavior of empty histograms to only export the count. Thus the com.twitter.finagle.stats.exportEmptyHistograms toggle now defaults to 0.0. RB_ID=882522

    ๐Ÿ’ฅ Breaking API Changes

    
    * ๐Ÿ”ง finagle: Some APIs around configuring TLS/SSL on Finagle clients have changed to
      unblock Netty 4 adoption. ``RB_ID=890935``
    
      - `c.t.f.Http.client.withTls(Netty3TransporterTLSConfig)` is removed. Use
        variations of `c.t.f.Http.client.withTransport.tls` instead.
    
      - `c.t.f.netty3.Netty3TransporterTLSConfig` is removed.
    
    * ๐Ÿ”ง finagle: Some APIs around configuring TLS/SSL on Finagle servers have changed to
      unblock Netty 4 adoption. ``RB_ID=891270``
    
      - `c.t.f.Http.server.withTls(Netty3ListenerTLSConfig)` is removed. Use
        variations of `c.t.f.Http.server.withTransport.tls` instead.
    
      - `c.t.f.netty3.Netty3ListenerTLSConfig` is removed.
    
    * ๐Ÿšš finagle-core: Removed the protected and unused method `read(permit: Permit): Future[Rep]`
      from `SerialClientDispatcher`. ``RB_ID=881978``
    
    * ๐Ÿšš finagle-core: Removed a gauge, `idle`, from `c.t.f.factory.ServiceFactoryCache`.
      ``RB_ID=884210``
    
    * finagle-core: `ServiceTimeoutException` now extends `NoStackTrace`. ``RB_ID=886809``
    
    * finagle-core: Marked `com.twitter.finagle.util.ConcurrentRingBuffer` as
      private.  It doesn't fit the typical programming model we encourage for
      users of finagle, and so we found it was rarely used.  ``RB_ID=888801``
    
    * finagle-core: Marked `transform` in `com.twitter.finagle.Stack` as protected. It is
      too powerful and unnecessary for users, and should be used by implementors only.
    
    * ๐Ÿšš finagle-core: Removed the `StatsReceiver` argument from `TimeoutFilter`.  ``RB_ID=891380``
    
    * finagle-core: Stopped exporting a few metrics related to deadlines, and replaced with a simpler
      one.  There was a per-`TimeoutFilter` one named `timeout/expired_deadline_ms`, and a per-server
      one named `admission_control/deadline/deadline_budget_ms`.  We added instead a per-server one
      named `admission_control/deadline/exceeded_ms`. ``RB_ID=891380``
    
    * finagle-http: HttpMuxer now takes in a Seq[Route] instead of a
      Seq[(String, Service[Request, Response])]. ``RB_ID=886829``
    
    * finagle-http: As part of the first step towards restructuring Finagle HTTP modules
      required for Netty 4 adoption, HTTP params are moved from the inner object `c.t.f.Http.param`
      into their own package `c.t.f.http.param`. ``RB_ID=885155``
    
    * finagle-redis: A couple of methods had to be renamed (and return type changed) to
      unblock Netty 4 adoption. ``RB_ID=882622``
    
      - `Command.toChannelBuffer` renamed to `Command.toBuf` and return
        type changed from N3 `ChannelBuffer` to Finagle `Buf`.
    
      - `Command.toByteArray` is removed.
    
      - Both `Command.key` and `Command.value` now implemented in terms of `Buf`s
        (no `ChannelBuffers`).
    
    * finagle-redis: An API around `c.t.f.redis.protocol.Command` was modernized as part of
      major restructuring required for the Netty 4 adoption. ``RB_ID=885811``
    
      - `RedisMessage` (a common parent for both `Command` and `Reply`) has been removed.
    
      - The encoding machinery was restructured to eliminate duplicated and dead code.
    
    * ๐Ÿšš finagle-thrift: Removed deprecated `ThriftRichClient.newServiceIface` methods
      which did not take a label. Use the versions that take a String label.
      ``RB_ID=891004``
    
    * ๐Ÿšš finagle-thrift: Removed deprecated `ThriftRichClient.newIface` methods based
      on `Groups`. Use the versions that a `dest` or `Name`. ``RB_ID=891004``
    
    * ๐Ÿšš finagle-thriftmux: Removed deprecated classes `ThriftMuxClient`, `ThriftMuxClientLike`,
      `ThriftMuxServer`, and `ThriftMuxServerLike`. ``RB_ID=880924``
    
    ๐Ÿ› Bug Fixes
    ~~~~~~~~~
    
    * finagle-core: The `withTlsWithoutValidation` and `tlsWithoutValidation`
      APIs have been fixed for an issue on Java 8 where certificate validation
      was being attempted instead of bypassed. ``RB_ID=881660``
    
    * finagle-http: The toggle implementation for `com.twitter.finagle.http.serverErrorsAsFailures`
      had a bug when toggled on. That toggle is no longer used and is superseded by
      `com.twitter.finagle.http.serverErrorsAsFailuresV2`. ``RB_ID=882151``
    
    * finagle-netty4: Connecting to a Socks 5 proxy using Finagle with Netty 4
      now works properly. This previously resulted in a timeout and
      `ProxyConnectException`. ``RB_ID=884344``
    
    * finagle-netty4: Don't swallow bind failures. ``RB_ID=892217``
    
    ๐Ÿ—„ Deprecations
    ~~~~~~~~~~~~
    
    * ๐Ÿ— finagle-core: `c.t.f.builder.ClientBuilder` deprecate some seldom used methods.
      The same functionality is available through the Stack-based APIs or
      `ClientBuilder.configured`. ``RB_ID=881612``
    
       - `hostConnectionIdleTime`
       - `hostConnectionMaxIdleTime`
       - `hostConnectionMaxLifeTime`
       - `hostConnectionMaxWaiters`