Moses Nakamura

@mnnakamura

Posted March 4, 2022

February 2022 Release Notes - Version 22.2.0

One of the joys of winter is drinking a mug of hot cocoa, curling up in a nook, and warming yourself by the heat of your computer compiling Scala code ☕🖥️🔥

We have a new release, and no houses were burned down in electrical fires while getting it to you.

Util

New Features

  • util-core: Added Memoize.classValue as a Scala-friendly API for java.lang.ClassValue. b696fdfd
  • util-jvm: Register JVM expression including memory pool usages (including code cache, compressed class space, eden space, sheap, metaspace, survivor space, and old gen) and open file descriptors count in StatsReceiver. ad617fe9
  • util-slf4j-jul-bridge: Add Slf4jBridge trait which can be mixed into extensions of c.t.app.App in order to attempt installation of the SLF4JBridgeHandler via the Slf4jBridgeUtility in the constructor of the c.t.app.App instance. ab73d64f

Runtime Behavior Changes

  • util-slf4j-api: Update the Logger API to include “call-by-name” method variations akin to the Logging trait. When creating a Logger from a Scala singleton object class, the resultant logger name will no longer include the \$ suffix. Remove the deprecated Loggers object which is no longer needed for Java compatibility as users can now directly use the Logger apply functions with no additional ceremony. cd99f165
  • util: Bump version of Caffeine to 2.9.3. 07b5c2ef

Breaking API Changes

  • util-core: The c.t.util.Responder trait has been removed. 88d3c95a

Scrooge

New Features

  • scrooge-core: c.t.scrooge.ThriftStructCodec.forStructClassTag API for retrieving the codec for a struct or union class given a class tag or manifest and c.t.scrooge.ThriftStructMetadata.forStructClassTag for retrieving its metadata. ba1a97bc
  • scrooge-core: c.t.scrooge.ThriftStructCodec.forStructClass API for retrieving codec for a struct or union class and c.t.scrooge.ThriftStructMetadata.forStructClass for similarly retrieving its metadata. PHAB_ID=_D825675
  • scrooge-generator: for each method defined in a service in the Thrift IDL, if any request arg of a method has annotations started with validation., generate a new trait ServerValidationMixin with a new API violationReturning<method_name> which validates incoming request (of Struct, Union, Exception types) and return any violations (as method parameters <request_variable>Violations) back to the users in the method API. aa83a3f5

Breaking API Changes

  • scrooge-generator: the c.t.scrooge.frontend.ThriftParser now always throws exceptions rather than warnings when a fieldname matches a reserved keyword. See c.t.scrooge.frontend.ThriftKeywords for the full list of disallowed keywords. 33767856

Finagle

New Features

  • finagle-logging: Introduced finagle-logging, a new module for SLF4J-integrated filters. 0e6a3b68
  • finagle-logging: Introduced SlowTracesFilter, which observes your requests and logs the slowest ones that are also sampled for tracing. 0e6a3b68
  • finagle-core: Introduced MinSendBackupAfterMs to the stack param Configured in BackupRequestFilter and propagated changes to MethodBuilder by adding new versions of idempotent function. When traffic load is low, this is useful to increase the delay when backup requests are sent and prevent the client from sending unnecessary backup requests. b0b8a6bb
  • finagle-core: Added a new annotation clnt/has_dark_request in tracing and Finagle Local context. The new annotation can be used to indicate whether or not the request has a span that is sent to dark service. dab1e48d

Bug Fixes

  • finagle-netty4-http: On a Request, adding multiple cookies with the same name to a CookieMap preserves all of them. Only cookies on Responses are deduplicated. Previously, adding a Request cookie with the same name would overwrite the old value with the new value. 6a49bfda
  • finagle-postgres: Fixed a bug where a single framer instance was shared across all connections to a host when using TLS. 185e2115

Breaking API Changes

  • finagle-core: Changed the shouldInvoke parameter in method serviceConcurrently and sendDarkRequest in AbstractDarkRequestFilter to be a Boolean instead of a function of (Req => Boolean). dab1e48d
  • finagle-core: Renamed the existing clnt/dark_request to clnt/is_dark_request in c.t.finagle.filter.DarkTrafficFilterdab1e48d

Runtime Behavior Changes

  • finagle: Bump version of Caffeine to 2.9.3. c42cea2c
  • finagle: Upgrade to Netty 4.1.73.Final and netty-tcnative 2.0.46.Final.cccbae40
  • finagle-core: in TimeoutFilter, only transform a timeout exception caused by TimeoutFilter. This also changes the type of exception raised by the TimeoutFilter from a java.util.concurrent.TimeoutException to a com.twitter.finagle.RequestTimeoutException. 6a95f37d
  • finagle-mux: Exceptions raised when Mux negotiation has failed have been moved to a Debug log level as the stack trace is generally long and not necessarily helpful. The logged message now includes the remote address and that is logged at both the Debug level (with the exception and stack trace) and Warning level (without). 712878ef
  • finagle-core: c.t.f.ssl.SslConfigurations.initializeSslContext now creates an engine which includes TLSv1.3 as a supported protocol. cc6c9db8
  • finagle-netty4: c.t.f.n.ssl.client.Netty4ClientSslConfigurations.createClientContext and c.t.f.n.ssl.server.Netty4ServerSslConfigurations.createServerCont ext now create contexts using the provided cipher suites. 9c6898ef

Twitter Server

No Changes

Finatra

  • inject-modules: Deprecate c.t.inject.modules.LoggerModule. Update c.t.inject.app.App to mix in the util/util-slf4j-jul-bridge Slf4jBridge trait. The LoggerModule does not provide a solution inline with the best practices for bridging JUL to the SLF4J-API and users are encouraged to instead mix in the c.t.util.logging.Slf4jBridge into the main class of their application if necessary. The updates to c.t.inject.app.App will now properly bridge JUL to the SLF4J-API early in the constructor of the application catching any log messages emitted to JUL before where the bridging would have been attempted when using the LoggerModule.

    Note that Slf4jBridge trait is already mixed into the c.t.server.TwitterServer trait and thus no further action is necessary forbridging JUL to the SLF4J-API in extensions of c.t.server.TwitterServer. 83360745

  • inject-slf4j: Deprecate c.t.inject.logging.Logging trait and methods. Users are encouraged to use the c.t.util.logging.Logging trait directly. There are no replacements for c.t.inject.logging.Logging#debugFutureResult and c.t.inject.logging.Logging#time. 084257a9