Dave Rusek

@davidjrusek

Posted November 13, 2018

November 2018 Release Notes - Version 18.11.0 ❄️

Halloween has come and gone and it’s already snowing here in the Rockies. Time to cuddle up with a warm compiler and check out the new edition of Twitter’s open source libraries!

Finagle

New Features

  • finagle-base-http: Add Message.httpDateFormat(millis) to format the epoch millis into an RFC 7231 formatted String representation. eb9bec0e

  • finagle-core: Introduce an StackClient.withStack overload that makes modifying the existing Stack easier when using method chaining. 8f69e833

  • finagle-mysql: Introduce session to be able to perform multiple operations that require session state on a guaranteed single connection. a06f7d67

  • finagle-netty4: When using the native epoll transport, finagle now publishes the TCP window size and number of retransmits based on the tcpInfo provided by from the channel. These stats are published with a debug verbosity level. 16071088

  • finagle-http: HTTP clients and servers now accept fixedLengthStreamedAfter param in their withStreaming configuration (default: 5 MB when streaming is enabled). This new parameter controls the limit after which Finagle will stop aggregating messages with known Content-Length (payload will be available at .content) and switch into a streaming mode (payload will be available at .reader). Note messages with Transfer-Encoding: chunked never aggregated. 842e5e1a

Breaking API Changes

  • finagle-http: c.t.f.http.param.MaxChunkSize has been removed. There is no good reason to configure it with anything but Int.MaxValue (unlimited). 990c8650

  • finagle-exp: Update DarkTrafficFilter#handleFailedInvocation to accept the request type for more fidelity in handling the failure. b247f941

Runtime Behavior Changes

  • finagle-http: Unset maxChunkSize limit in Netty HTTP codecs. Now both clients and servers emit all available data as a single chunk so we can put it into use quicker. 990c8650

  • finagle-http: Streaming clients (withStreaming(true)) now aggregate inbound messages with known Content-Length if their payloads are less than 5mb (8k before). Use withStreaming(true, 32.kb) to override it with a different value. 24271b29

  • finagle-http2: HTTP/2 servers perform a more graceful shutdown where an initial GOAWAY is sent with the maximum possible stream id and waits for either the client to hang up or for the close deadline, at which time a second GOAWAY is sent with the true last processed stream and the connection is then closed. 93fee499

Deprecations

  • finagle-core: Deprecate EndpointerStackClient.transformed(Stack[ServiceFactory[Req, Rep]] => Stack[ServiceFactory[Req, Rep]]) in favor of the withStack variant. 8f69e833

Finatra

Changed

  • finatra-thrift: Fixes and improvements for better Java support. ExceptionMappingFilter now works properly with generated Java controllers, added an exception mapper for the exceptions defined in finatra_thrift_exceptions.thrift which works on the geneated Java code for these exceptions. Better Java API separation to make usage less error prone and confusing. f6c44cab

  • finatra-thrift: (BREAKING API CHANGE) Update DarkTrafficFilter#handleFailedInvocation to accept the request type for more fidelity in handling the failure. 20bd33ac

  • finatra-http: Move request.ContentType and response.Mustache Java annotations to com.twitter.finatra.http package namespace. ef135610

  • finatra-jackson: Move away from deprecated code and update error handling and exceptions post Jackson 2.9.x upgrade. f1e5c96e

  • inject-core: (BREAKING API CHANGE) Remove c.t.inject.TestMixin#sleep. We do not want to promote this usage of Thread blocking in testing utilities. Add a new testing function: c.t.inject.TestMixin#await which will perform Await.result on a given c.t.util.Awaitable. This function was duplicated across tests in the codebase. We also introduce an overridable default timeout on the underlying Await.result call: c.t.inject.TestMixin#defaultAwaitTimeout. 4aee1051

Fixed

  • finatra-http: Fix registration of HTTP Routes in the Library registry to properly account for Routes that duplicate a URI with a different HTTP verb. That is, a Route should be considered unique per URI + HTTP verb combination. 6a715075

Scrooge

  • scrooge-generator: Allow for Filter.TypeAgnostic filters to be applied to a generated Java Service via a new constructor that takes an additional argument of a Filter.TypeAgnostic. This filter is then applied per generated method service. 19c7d58b

Twitter Server

No Changes

Util

Breaking API Changes

  • util-core: c.t.u.Future.raiseWithin methods now take the timeout exception as a call-by-name parameter instead of a strict exception. While Scala programs should compile as usual, Java users will need to use a scala.Function0 as the second parameter. The helper c.t.u.Function.func0 can be helpful. 9bde57ca

  • util-core: Rename c.t.io.Reader.ReaderDiscarded to c.t.io.ReaderDiscardedException. a970c5b5

Runtime Behavior Changes

  • util-core: Made Stopwatch.timeNanos monotone. 8d35b496