Yufan Gong

@yufangong

Posted April 26, 2020

April 2020 Patch Release Notes - Version 20.4.1

April Release encountered some issues running on JDK 8, here’s a patch release that should address it.

Finagle

New Features

  • finagle-redis: Add ConnectionInitCommand stack to set database and password. 9fe05301

  • finagle-mysql: Add ConnectionInitSql stack to set connection init sql. bd4411dd

Runtime Behavior Changes

  • finagle-core: Requeued reqeuests due to the c.t.finagle.service.RequeueFilter will generate their own spanId. af490773

Bug Fixes

  • finagle-core: Restrict OffloadFilter from allowing interruption of the work performed in the worker pool. This is to ensure that the worker thread isn’t interruptible, which is a behavior of certain FuturePool implementations. f0af6ad7 59f9f2b5

  • finagle-netty4: ChannelStatsHandler will now only count the first channel close(..) call when incrementing the closes counter. 3fa91944

Breaking API Changes

  • finagle-toggle: Removed abstract type for c.t.finagle.Toggle, all Toggles are of type Int. This is to avoid Integer auto-boxing when calling Toggle.apply, thus to improve overall toggle performance. c81a87b0

  • finagle-core: Retried requests due to the c.t.finagle.service.RetryFilter will generate their own spanId. 762471a0

Finatra

Added

  • inject-app: Add default type conversions for java.time.LocalTime, c.t.util.Time, java.net.InetSocketAddress, and c.t.util.StorageUnit. This allows the injector to convert from a String representation to the given type. The type conversion for java.net.InetSocketAddress uses the c.t.app.Flaggable.ofInetSocketAddress implementation and the type conversion for c.t.util.Time uses the c.t.app.Flaggable.ofTime implementation for consistency with Flag parsing. Because of the current state of type erasure with c.t.app.Flag instances, Finatra currently binds a parsed c.t.app.Flag value as a String type, relying on registered Guice TypeConverters to convert from the bound String type to the requested type. These conversions now allow for a c.t.app.Flag defined over the type to be injected by the type as Guice now has a type conversion from the bound String type rather than as a String representation which then must be manually converted. 20ac122f

  • finatra-http: Method in tests to return an absolute path URI with the https scheme and authority ffed3815

  • finatra: Java-friendly bindClass test APIs. The bindClass API calls from Java can be now chained with the TestInjector, EmbeddedApp, EmbeddedTwitterServer, EmbeddedThriftServer, and EmbeddedHttpServer. For example, the following is now possible:

  EmbeddedHttpServer server = new EmbeddedHttpServer(
      new HelloWorldServer(),
      Collections.emptyMap(),
      Stage.DEVELOPMENT)
      .bindClass(Integer.class, Flags.named("magic.number"), 42)
      .bindClass(Integer.class, Flags.named("module.magic.number"), 9999);
  return server;

e2b204a8

Changed

  • inject-app: Introduce consistent c.t.app.Flag creation methods for Java. Bring HTTP and Thrift server traits inline with each other to provide consistent Java support. Ensure Java examples in documentation. c7d8c46c

  • inject-core: Update the configuration of c.t.app.Flag instances created within a c.t.inject.TwitterModule to have failFastUntilParsed set to ‘true’ by default. While this is configurable for a given c.t.inject.TwitterModule, much like for the application itself, it is STRONGLY recommended that users adopt this behavior. e74ef0a3

  • inject-app: Update c.t.inject.app.TestInjector to always add the InjectorModule. 6e53e77a

  • inject-app: Reduce visibility of internal code in c.t.inject.app.internal. a166dc89

  • inject-modules: Updated BUILD files for Pants 1:1:1 layout. a4fbbd19

Fixed

  • finatra-kafka: Close a result observer when Namer.resolve fails. f358993f

Util

New Features

  • util-tunable: ConfigurationLinter accepts a relative path. 71d39d80

Twitter Server

No Changes

Scrooge

  • scrooge-generator: Respect the proper order of separators in function declarations. b72a08c9

  • scrooge-generator: Optimized generated Scala code for compile time and smaller bytecode. Companion objects for thrift enum traits are no longer case objects. 2189d281