Ian Bennett

@enbnt

Posted March 30, 2021

🌷 March 2021 Release Notes - Version 21.3.0

As the 🐻 animals 🐿️ awaken from hibernation, we too have awoken the 🐆 beast 🐅 with this release. Please enjoy!

NOTE

As we noted in the 21.2.0 release, we cross-build for Scala 2.12 and Scala 2.13 for all of our projects and we have dropped support for Scala 2.11 with this release. For Finatra users, please pay special attention to the notes, as the finatra/http project has been renamed to finatra/http-server, finatra/httpclient has been moved to finatra/http-client for consistency, and artifacts that are meant to be shared between the server and experimental finatra/http-client have moved to finatra/http-core.

Finagle

New Features

  • finagle-core: Added value ForceWithDtab to flag -com.twitter.finagle.loadbalancer.exp.apertureEagerConnections that forces the aperture load balancer to eagerly connect, even in staging environments where Dtab locals are set. 9dab522d
  • finagle-core: Introduce a new Backoff to create backoffs based on varies strategies, where backoffs are calculated on the fly, instead of being created once and memoized in a Stream. Also introduced Backoff.fromStream(Stream) and Backoff.toStream to help with migration to the new API. 91d24c33
  • finagle-netty4: Upgrade to Netty 4.1.59.Final and TcNative 2.0.35.Final. ee6ced91
  • finagle-http: Integrate Kerberos authentication filter to finagle http client and server. e3bfa0c3 eefc21c8
  • finagle-core: Provided c.t.f.ssl.TrustCredentials.X509Certificates to enable directly passing X509Certificate instead of passing a File. 61c2a596

Breaking API Changes

  • finagle: Builds are now only supported for Scala 2.12+ 8a48eab7
  • finagle-core: Changed flag -com.twitter.finagle.loadbalancer.exp.apertureEagerConnections" from having Boolean values true or false to EagerConnectionsType` values Enable, Disable, and ForceWithDtab. 9dab522d
  • finagle-mysql: The constructor of c.t.f.mysql.transport.MysqlBufReader now takes an underlying c.t.io.ByteReader. Prior uses of the constructor, which took a c.t.io.Buf, should migrate to using c.t.f.mysql.transport.MysqlBufReader.apply instead. ad73f92d
  • finagle-base-http: Kerberos jaas config KerberosConfiguration is replaced with ServerKerberosConfiguration and ClientKerberosConfiguration concrete classes.

Runtime Behavior Changes

  • finagle: Revert to scala version 2.12.12 due to https://github.com/scoverage/sbt-scoverage/issues/319 c2db97c2
  • finagle: Bump scala version to 2.12.13 b8e4e0ac
  • finagle-core: Move helper tracing methods like traceLocal in Trace into the Tracing class. This allows cheaper use of these APIs by first capturing a Trace via Trace#apply, avoiding the extra lookups that will add overhead on the request path. ec0097cd.
  • finagle-core: c.t.finagle.InetResolver, c.t.finagle.builder.ClientBuilder, c.t.finagle.liveness.FailureAccrualFactory, c.t.finagle.liveness.FailureAccrualPolicy, c.t.finagle.param.ClientParams, c.t.finagle.param.SessionQualificationParams, c.t.finagle.service.FailFastFactory, c.t.finagle.service.RequeueFilter, c.t.finagle.service.Retries, c.t.finagle.service.RetryFilter, and c.t.finagle.service.RetryPolicy will accept the new c.t.finagle.service.Backoff to create backoffs. Services can convert a Stream to/from a Backoff with Backoff.fromStream(Stream) and Backoff.toStream. 91d24c33
  • finagle-core: remove the com.twitter.finagle.loadbalancer.apertureEagerConnections Toggle and change the default behavior to enable eager connections for c.t.f.loadbalancer.ApertureLeastLoaded and c.t.f.loadbalancer.AperturePeakEwma load balancers. The state of the com.twitter.finagle.loadbalancer.apertureEagerConnections GlobalFlag now also defaults to enable this feature (Enable. You can disable this feature for all clients via setting the com.twitter.finagle.loadbalancer.apertureEagerConnections GlobalFlag to Disable for your process. (i.e. -com.twitter.finagle.loadbalancer.apertureEagerConnections=Disable). ef8d536e

Deprecations

  • finagle-core: Backoff.fromJava is marked as deprecated, since the new Backoff is java-friendly. For services using Stream.iterator on the old Backoff, please use the new API Backoff.toJavaIterator to acquire a java-friendly iterator. 91d24c33

Finatra

Added

  • inject-thrift-client: Add per-method retry configuration withMaxRetries in com.twitter.inject.thrift.ThriftMethodBuilder for customizing configureServicePerEndpoint. be9f27c8

Breaking API Changes

  • finatra: Deprecate c.t.inject.utils.AnnotationUtils, users should instead use c.t.util.reflect.Annotations from com.twitter:util-reflect. Deprecate c.t.finatra.utils.ClassUtils, users should instead use either c.t.util.reflect.Classes#simpleName, c.t.util.reflect.Types#isCaseClass or c.t.util.reflect.Types#notCaseClass from com.twitter:util-reflect. 291d1b78
  • finatra: Builds are now only supported for Scala 2.12+ 5f08f469

Changed

  • finatra: Revert to scala version 2.12.12 due to https://github.com/scoverage/sbt-scoverage/issues/319 6f74aedb
  • finatra: Bump scala version to 2.12.13 029c7500
  • finatra: Move com.twitter.finatra.http.{jsonpatch,request} from the finatra/http-server project to finatra/http-core project. Please update your build artifact references accordingly. f8a810b2
  • http-server,http-core,jackson,thrift,validation: Update to use c.t.util.reflect.Types in places for TypeTag reflection. c132a053
  • finatra: Move c.t.finatra.http.{context,exceptions,response} from the finatra/http-server project to finatra/http-core project. Please update your build artifact references accordingly. 9f6c9405
  • finatra: Move c.t.finatra.http.streaming from the finatra/http-server project to finatra/http-core project. Please update your build artifact references accordingly. d454fd0e
  • http-core: Introduce c.t.finatra.http.marshalling.MessageBodyManager#builder for creating an immutable c.t.finatra.http.marshalling.MessageBodyManager. The MessageBodyManager’s constructor is now private. d8886dab
  • http-server: Move c.t.finatra.http.modules.MessageBodyFlagsModule to c.t.finatra.http.marshalling.modules.MessageBodyFlagsModule. 0cd97c79
  • validation: Remove deprecated constraint type aliases under com.twitter.finatra.validation, users should prefer the actual constraint annotations at com.twitter.finatra.validation.constraints. 498ebe4a
  • jackson: Remove deprecated com.twitter.finatra.json.utils.CamelCasePropertyNamingStrategy, users should prefer to use PropertyNamingStrategy#LOWER_CAMEL_CASE or an equivalent directly. Also remove the deprecated com.twitter.finatra.json.annotations.JsonCamelCase, users should use the @JsonProperty or @JsonNaming annotations or an appropriately configured Jackson PropertyNamingStrategy instead. da836c55
  • inject-core: (BREAKING API CHANGE) Rename c.t.inject.TwitterModule.closeOnExit to onExit so it mirrors the API from c.t.inject.App. b8f00879
  • http-client: Remove deprecated c.t.finatra.httpclient.modules.HttpClientModule. Use c.t.finatra.httpclient.modules.HttpClientModuleTrait instead. 333c782a
  • http-client: Remove deprecated c.t.finatra.httpclient.RichHttpClient. Use c.t.finagle.Http.Client or c.t.finatra.httpclient.modules.HttpClientModuleTrait instead. Additionally, c.t.finatra.httpclient.modules.HttpClientModule.provideHttpService has been removed. Use c.t.finatra.httpclient.modules.HttpClientModuleTrait.newService(injector, statsReceiver) instead. 2af18ede
  • finatra: Move c.t.finatra.http.fileupload from the finatra/http-server project to finatra/http-core project. Please update your build artifact references accordingly. 8b0ea169
  • http-client: Remove deprecated method get from c.t.finatra.httpclient.HttpClient. Use HttpClient’s execute instead. eada0515
  • finatra: Create the finatra/http-core project, which is meant to contain common artifacts for the finatra/http-server and finatra/http-client project. As part of this change, the com.twitter.finatra.httpclient.RequestBuilder has been deprecated and should be updated to reference com.twitter.finatra.http.request.RequestBuilder. 5e3da631
  • finatra: Rename the finatra/httpclient project to finatra/http-client. Please update your build artifact references (i.e. SBT, Maven) to use “finatra-http-client”. c0b0ae61
  • kafkaStreams: Switch the default Kafka client and Kafka Stream client to version 2.4.1. d2367485
  • finatra: Rename the finatra/http project to finatra/http-server. Please update your build artifact references (i.e. SBT, Maven) to use “finatra-http-server”. See the Finatra User’s Guide 2cb398e6

Util

Runtime Behavior Changes

Breaking API Changes

  • util: Rename c.t.util.reflect.Annotations#annotationEquals to c.t.util.reflect.Annotations#equals and c.t.util.reflect.Types.eq to c.t.util.reflect.Types.equals. e90c5c61
  • util: Builds are now only supported for Scala 2.12+ 2c90e2fc
  • util-reflect: Remove deprecated c.t.util.reflect.Proxy. There is no library replacement. 62a3169d
  • util-security: Renamed com.twitter.util.security.PemFile to c.t.u.security.PemBytes, and changed its constructor to accept a string and a name. The main change here is that we assume the PEM-encoded text has been fully buffered. To migrate, please use the helper method on the companion object, PemBytes#fromFile. Note that unlike before with construction, we read from the file, so it’s possible for it to throw. 5876adfc

New Features

  • util-reflect: Add c.t.util.reflect.Annotations a utility for finding annotations on a class and c.t.util.reflect.Classes which has a utility for obtaining the simpleName of a given class across JDK versions and while handling mangled names (those with non-supported Java identifier characters). Also add utilities to determine if a given class is a case class in c.t.util.reflect.Types. 95c45f71
  • util-reflect: Add c.t.util.reflect.Types, a utility for some limited reflection based operations. 7e32800a
  • util-core: c.t.io now supports creating and deconstructing unsigned 128-bit buffers in Buf. 955754d4
  • util-core: c.t.io.ProxyByteReader and c.t.io.ProxyByteWriter are now public. They are useful for wrapping an existing ByteReader or ByteWriter and extending its functionality without modifying the underlying instance. 35abecad
  • util-core: Provided c.t.u.security.X509CertificateDeserializer to make it possible to directly deserialize an X509Certificate even if you don’t have a file on disk. Also provided c.t.u.security.X509TrustManagerFactory#buildTrustManager to make it possible to directly construct an X509TrustManager with an X509Certificate instead of passing in a File. 5876adfc

Scrooge

Runtime Behavior Changes

Breaking API Changes

  • scrooge: Builds are now only supported for Scala 2.12+ 72f5a0a0

TwitterServer

Breaking API Changes

  • com.twitter.server.util.JsonConverter is divided into two Json mappers, JsonConverter and AdminJsonConverter. JsonConverter keeps the minimum configuration, for json mapping to/from twitter-server admin endpoints, AdminJsonConverter is configured to do so. c90fa00c
  • Json.scala and JsonConverter are merged, removed the Json.deserialize() methods. c90fa00c

Runtime Behavior Changes

Changelogs