Dorothy Ordogh

@dordogh

Posted July 18, 2019

July 2019 Release Notes - Version 19.7.0

Finagle

New Features

  • finagle-http: Measure streaming (message.isChunked) chunk payload size with two new histograms: stream/request/chunk_payload_bytes and stream/response/chunk_payload_bytes, they are published with a debug verbosity level. These chunk payload sizes are also traced via the same trace keys. 11f4e32c
  • finagle-base-http: Add support for new “b3” tracing header. 87218372
  • finagle-core: Allow to not bypass SOCKS proxy for localhost by using the GlobalFlag -com.twitter.finagle.socks.socksProxyForLocalhost 5521bc83
  • finagle-core: OffloadFilter flag to reduce network contention. 2bd4d61b
  • finagle-exp: Add private c.t.f.exp.ConcurrencyLimitFilter for rejecting requests that exceed estimated concurrency limit e331491c

Runtime Behavior Changes

  • finagle-http: c.t.f.http.Cors has been changed to no longer use the c.t.f.http.Response associated with the passed in c.t.f.http.Request. 455718a5
  • finagle-http: c.t.f.http.filter.ExceptionFilter has been changed to no longer use the c.t.f.http.Response associated with the passed in c.t.f.http.Request. 54d4acf1
  • finagle-http: Optimize creation of new Http Dispatchers by re-using created metrics and loggers. 9156f0f8

Breaking API Changes

  • finagle-base-http: Removed the methods setStatusCode and getStatusCode from c.t.f.http.Response which have been deprecated since 2017. 20b37b0b
  • finagle-core: All deprecated c.t.f.builder.ServerBuilder#build methods have been removed. Users should migrate to using the build method which takes a ServiceFactory[Req, Rep] as a parameter. 7ae208df
  • finagle-core: The c.t.f.ssl.client.SslClientEngineFactory#getHostname method has been removed. All uses should be changed to use the getHostString method of SslClientEngineFactory instead. PHAB_ID=DD334087
  • finagle-http: The setOriginAndCredentials, setMaxAge, setMethod, and setHeaders methods of c.t.f.http.Cors.HttpFilter are no longer overridable. 455718a5
  • finagle-http: The details of the c.t.f.Http.HttpImpl class are meant to be implementation details so the class constructor was made private along with the fields. Along these same lines the c.t.f.Http.H2ClientImpl.transporter method has been moved to a private location. 1338e508

Bug Fixes

  • finagle-core: Ensure ClientDispatcher queueSize gauge is removed on transport close, instead of waiting for clean-up at GC time. 963e9b84
  • finagle-http2: Don’t propagate stream dependency information for the H2 client. a2e6c0ba

Finatra

Added

  • finatra-kafka-streams: Adding test/sample for FinatraDslWindowedAggregations.aggregate. ae433fc9
  • finatra-jackson: Add com.twitter.util.Time deserializer with JsonFormat support. ed3d666a

Changed

  • finatra-kafka: BUILD file update compile and runtime deps. 8241cd7c
  • finatra-httpclient: introduce new HttpClientModuleTrait and deprecate HttpClientModule. The HttpClientModule has been modified to extend from HttpClientModuleTrait to allow for bridging the two implementations. c.t.f.httpclient.RichHttpClient has also been deprecated as part of this change. The new HttpClientModuleTrait allows for direct configuration of the underling c.t.finagle.Http.Client. The new HttpClientModuleTrait does not provide any default bindings, so it is up to users to supply them - this allows for custom binding annotations and binding multiple HttpClients, which was not previously possible with HttpClientModule. fe0c94aa

    To migrate,

    class MyHttpClientModule extends HttpClientModule {
      override val dest = "flag!mydest"   
      override val sslHostname = Some("sslHost")
    }
    

    becomes

    class MyHttpClientModule extends HttpClientModuleTrait {
      override val dest = "flag!mydest"
      override val label = "myhttpclient"
      val sslHostname = "sslHost"  
      // we only override in this example for TLS configuration with the `sslHostname`
      override def configureClient(
        injector: Injector,
        client: Http.Client
      ): Http.Client = client.withTls(sslHostname)
    
      @Singleton
      @Provides
      final def provideHttpClient(
        injector: Injector,
        statsReceiver: StatsReceiver,
        mapper: FinatraObjectMapper
      ): HttpClient = newHttpClient(injector, statsReceiver, mapper)
    
      // Note that `provideHttpClient` no longer needs an injected `Service[Request, Response]` so
      // the following is only needed if you require a `Service[Request, Response]` elsewhere:
    
      @Singleton
      @Provides
      final def provideHttpService(
        injector: Injector,
        statsReceiver: StatsReceiver
      ): Service[Request, Response] = newService(injector, statsReceiver)
    
    } 
    

Scrooge

  • scrooge-generator: A deprecated \$FinagleClient constructor which does not use RichClientParam has been removed. 28061ba9

Twitter Server

Changes

  • Remove c.t.server.util.TwitterStats as it is dead code. 55d6d288

Util

Breaking API Changes

  • util-core: Removed deprecated c.t.concurrent.Scheduler methods usrTime, cpuTime, and wallTime. These were deprecated in 2015 and have no replacement. 0d77572c
  • util-core: Removed deprecated com.twitter.logging.config classes SyslogFormatterConfig, ThrottledHandlerConfig, SyslogHandlerConfig. These were deprecated in 2012 and have no replacement. Users are encouraged to use ‘util-slf4j-api’ where possible. 28d9de59

Runtime Behavior Changes

  • util-core: Remove experimental toggle com.twitter.util.BypassScheduler used for speeding up ConstFuture.map (transformTry). Now, we always run map operations immediately instead of via the Scheduler, where they may be queued and potentially reordered. 64114324