Ryan O'Neill

@ryanoneill

Posted May 21, 2019

May 2019 Release Notes - Version 19.5.1

With it being late May, the beginning of summer is right around the corner. Along with that comes a new release of our libraries. Unfortunately, there was an issue with our first attempt (19.5.0) so we created a point release (19.5.1), which fixes the problem. Here are the changes for both 19.5.0 and 19.5.1

Finagle

New Features

  • finagle-http: Add two new methods to com.twitter.finagle.http.MediaType, MediaType#typeEquals for checking if two media types have the same type and subtype, ignoring their charset, and MediaType#addUtf8Charset for easily setting a utf-8 charset. ec0953f1

Bug Fixes

  • finagle-http: Ensure server returns 400 Bad Request when non-ASCII characters are present in the HTTP request URI path. a7dae7ea

Runtime Behavior Changes

  • finagle-core: Deterministic aperture (d-aperture) load balancers no longer export “loadband” scoped metrics: “widen”, “narrow”, “offered_load_ema”. These were not necessary as d-aperture does not change the aperture size at runtime. 20029ac5
  • finagle-core: Request logging now defaults to disabled. Enable it by configuring the RequestLogger Stack parameter on your Client or Server. ee9cb4ec
  • finagle-core: Subtree binding failures in NameTree.Union‘s are ignored in the final binding result. 2fde4d2d

Breaking API Changes

  • finagle-core: The c.t.f.client.EndpointerModule and c.t.f.pushsession.PushStackClient public and protected APIs have been changed to use the abstract java.net.SocketAddress instead of the concrete java.net.InetSocketAddress as relying on the concrete implementation was not necessary. 77a3cdfd
  • finagle-http: For Finagle HTTP clients, the withMaxRequestSize(size) API method has been removed. For Finagle HTTP servers, the withMaxResponseSize(size) method has been removed. The underlying Stack params which are set by these methods are respectively HTTP server and HTTP client side params only. Using these removed methods had no effect on the setup of Finagle HTTP clients and servers. 5eb3ae24
  • finagle-mysql: HandshakeResponse has been removed from finagle-mysql’s public API. It is expected that users of the library are relying entirely on finagle-mysql for handshaking. f0ab09a6

Finatra

Added

  • inject-server/http/thrift: Allow users to specify a StatsReceiver implementation to use in the underlying EmbeddedTwitterServer instead of always providing an InMemoryStatsReceiver implementation. 7a486fd2
  • finatra-http: Add ability for Java HTTP Controllers to use the RouteDSL for per-route filtering and for route prefixing. c2733158
  • inject-request-scope: Add a Filter.TypeAgnostic implementation for the FinagleRequestScopeFilter for better compatibility with Thrift servers. Update the FinagleRequestScope to make more idiomatic use of Context locals. 451cff77
  • finatra-http: Route params are now URL-decoded automatically. a79f5634
  • finatra-jackson: Add ability to bypass case class validation using the NullValidationFinatraJacksonModule. 401d7285
  • inject-app: Add c.t.inject.app.DtabResolution to help users apply supplemental Dtabs added by setting the dtab.add flag. This will append the supplemental Dtabs to the Dtab.base in a premain function. 6c4eeda0

Changed

  • finatra-http: Move when admin routes are added to the AdminHttpServer to the postInjectorStartup phase, such that any admin routes are available to be hit during server warmup. Simplify HttpWarmup utility to make it clear that it can and should only be used for sending requests to endpoints added to the server’s configured HttpRouter. The forceRouteToAdminHttpMuxers param has been renamed to admin to signal that the request should be sent to the HttpRouter#adminRoutingService instead of the HttpRouter#externalRoutingService. Routing to TwitterServer HTTP Admin Interface via this utility never worked properly and the (broken) support has been dropped. 0cd3ed69
  • finatra-kafka: Update com.twitter.finatra.kafka.test.KafkaTopic, and com.twitter.finatra.kafka.test.utils.PollUtils methods to take com.twitter.util.Duration instead of org.joda.time.Duration. 94c051b3
  • finatra: Removed Commons IO as a dependency. 4b6e4726
  • finatra-http: com.twitter.finatra.http.EmbeddedHttpServer methods which previously used the routeToAdminServer parameter have been changed to use a RouteHint instead for added flexibility in controlling where a test request is sent. 4653992c
  • finatra-inject: Feature tests no longer default to printing metrics after tests. This can be enabled on a per-test basis by overriding FeatureTestMixin.printStats and setting it to true. 28eecabe
  • finatra-inject: Update com.twitter.inject.utils.RetryPolicyUtils, com.twitter.inject.thrift.modules.FilteredThriftClientModule, and com.twitter.inject.thrift.filters.ThriftClientFilterChain methods to take com.twitter.util.Duration instead of org.joda.time.Duration. c295efb0
  • finatra: Fix Commons FileUpload vulnerability. Update org.apache.commons-fileupload from version 1.3.1 to version 1.4. This closes #PR-497. d5d32737
  • finatra-http: Replace all usages of guava’s com.google.common.net.MediaType with String. You can migrate by calling MediaType#toString everywhere you passed a MediaType before. 826fabb2
  • finatra-http: Add http scope to shutdown.time flag, making it http.shutdown.time. 2abb46f8
  • finatra-http: Remove deprecated DefaultExceptionMapper. Extend c.t.finatra.http.exceptions.ExceptionMapper[Throwable] directly instead. cd2d5be3
  • inject-app: Move override of com.twitter.app.App#failfastOnFlagsNotParsed up from c.t.inject.server.TwitterServer to com.twitter.inject.app.App such that all Finatra-based applications default to this behavior. feb887e0
  • inject-app|server: change capturing of flag ordering from Modules for adding to the App’s c.t.app.Flags instance to match the semantics of directly calling c.t.app.Flags#add. Prefer AtomicBoolean instances over where we currently use mutable Boolean instances in c.t.inject.app.App, c.t.inject.app.TestInjector, and c.t.inject.server.EmbeddedTwitterServer. 2dfd33b5
  • finatra-examples: Update “twitter-clone” example to use Dtabs instead of the deprecated resolverMap. Move the “hello-world” example to “http-server”. 6c4eeda0

Fixed

  • finatra: The added c.t.finatra.http.RouteHint was missing from the test-jar sources and has been added. 7945d128
  • finatra-jackson: Properly account for timezone in Joda DateTime deserialization. abb17d5a
  • finatra-http: EmbeddedHttpServer’s httpGetJson method now properly passes all parameters through to the underlying client call. 068cd440

Scrooge

  • scrooge-generator: Extensions of (ReqRep)ServicePerEndpoint now provide a proper filtered method by default. e46b2785

Twitter Server

  • twitter-server: Add DuplicateFlagDefinitions lint rule which is violated when multiple Flags with the same name are added to the underlying com.twitter.app.App#flag com.twitter.app.Flags instance. fe231c9a

Util

  • util-app: Track the registration of duplicated Flag names. Currently, we print a warning to stderr but do not track the duplicated Flag names. Tracking them allows us to inspect and warn over the entire set. 4875552e