Permalink
Switch branches/tags
Commits on Aug 29, 2018
  1. jackson: Upgrade from 2.8.4 to 2.9.6

    mosesn authored and jenkins committed Aug 29, 2018
    Problem
    
    We're on a version of jackson from October 2016, and it has a [CVE][0] against it.
    Furthermore, there are bugfixes and feature improvements in new jackson, which
    we would like to use.
    
    Solution
    
    Upgrade to the latest and greatest version of jackson.
    
    [0]: https://nvd.nist.gov/vuln/detail/CVE-2017-7525
    
    JIRA Issues: CSL-6599
    
    Differential Revision: https://phabricator.twitter.biz/D204133
Commits on Aug 10, 2018
  1. finagle-core: Moved creation of ServiceClosedException in LazyEndpoin…

    mosesn authored and jenkins committed Aug 10, 2018
    …tFactory to the close method
    
    Problem
    
    ServiceClosedException in LazyEndpointFactory tells you who tried to use the
    endpoint factory after it was closed, but not who closed it.
    
    Solution
    
    Create ServiceClosedException only once, when it's closed, and remember it
    thereafter.  Also provide a useful exception message to SCE.
    
    JIRA Issues: CSL-6816
    
    Differential Revision: https://phabricator.twitter.biz/D200423
Commits on Jul 23, 2018
  1. finagle-http2: Hook up HeaderSensitivityDetector properly for cleartext

    mosesn authored and jenkins committed Jul 23, 2018
    Problem
    
    HeaderSensitivityDetector is hooked up properly for h2, but not for h2c or
    prior knowledge.
    
    Solution
    
    Hook up the header sensitivity detector unconditionally.
    
    JIRA Issues: CSL-6657
    
    Differential Revision: https://phabricator.twitter.biz/D195258
Commits on Jul 13, 2018
  1. finagle-http2: Provide AlwaysSensitive configuration option

    mosesn authored and jenkins committed Jul 13, 2018
    Problem
    
    It's not easy to mark everything as sensitive, which can be useful for disabling
    caching in the header table.
    
    Solution
    
    Provide a configuration option that marks everything as sensitive.
    
    Differential Revision: https://phabricator.twitter.biz/D191775
Commits on Jun 21, 2018
  1. finagle-mux: Propagates `Ignorable` status over the network

    mosesn authored and jenkins committed Jun 21, 2018
    Problem
    
    When a BackupRequestFilter raises on a dispatch that has already been sent over
    the wire, mux sends a Tdiscarded message so that the remote peer knows that the
    work is no longer needed.  When the server receives the message, it interrupts
    the dispatch on its end.  However, it loses the `Ignorable` status when it goes
    over the network.
    
    Solution
    
    We should inspect the `why` section of the Tdiscarded to see if it's from
    BackupRequestFilter, and if it is, then we should mark it as `Ignorable`.
    
    Result
    
    Stats and failure accrual on receivers don't get polluted by BackupRequestFilter
    interruptions from the receiver's callers.
    
    JIRA Issues: CSL-6516
    
    Differential Revision: https://phabricator.twitter.biz/D183456
Commits on Jun 18, 2018
  1. finagle-stats: Decrease contention in MetricsBucketedHistogram#add

    mosesn authored and jenkins committed Jun 18, 2018
    Problem
    
    When we profile h2 servers, we see contention in MetricsBucketedHistogram#add.
    
    Solution
    
    Change BucketedHistogram to be memory safe and remove intrinsic locking from
    MetricsBucketedHistogram.  I tried ReentrantReadWriteLock in BucketedHistogram,
    but it was too slow.  I tried several cheap read-write lock implementations
    (lock on updating an integer and spin, atomic integer and spin, semaphore, StampedLock)
    before finally settling on AQS, which is very fast.  I also started using an
    AtomicIntegerArray so that racing in `add` would be safe.  However, converting
    `num` and `total` to AtomicIntegers also lost us some speed.
    
    JIRA Issues: CSL-5626
    
    Differential Revision: https://phabricator.twitter.biz/D173413
Commits on Jun 6, 2018
  1. finagle-stats: Fast bucket finding with logarithms

    mosesn authored and jenkins committed Jun 6, 2018
    Problem
    
    We use binary search to find which bucket to use with our histograms, which
    incurs a bunch of comparison operations.
    
    Solution
    
    Since our bucketing scheme is exponential, we can take the logarithm to look
    up which bucket to use.
    
    Result
    
    Old:
    Result "com.twitter.finagle.stats.StatsReceiverBenchmark.addMetrics":
      305.403 ±(99.9%) 21.344 ns/op [Average]
      (min, avg, max) = (279.395, 305.403, 320.314), stdev = 14.118
      CI (99.9%): [284.059, 326.747] (assumes normal distribution)
    
    New:
    
    Result "com.twitter.finagle.stats.StatsReceiverBenchmark.addMetrics":
      237.653 ±(99.9%) 16.106 ns/op [Average]
      (min, avg, max) = (225.779, 237.653, 259.360), stdev = 10.653
      CI (99.9%): [221.546, 253.759] (assumes normal distribution)
    
    ~20% faster
    
    JIRA Issues: CSL-6430
    
    Differential Revision: https://phabricator.twitter.biz/D173981
Commits on May 16, 2018
  1. finagle-core: Reduce lock contention in Closables

    mosesn authored and jenkins committed May 16, 2018
    Problem
    
    We have to register and deregister a closable in Closables every time we receive
    a new request and then respond to it in h2.  High throughput servers have seen
    lock contention from this.
    
    Solution
    
    Use a ReadWriteLock instead of an intrinsic lock, and switch to using a CHM
    instead of a HashSet.
    
    JIRA Issues: CSL-5971
    
    Differential Revision: https://phabricator.twitter.biz/D171480
Commits on May 15, 2018
  1. finagle-http: Unflakify AbstractStreamingTest

    mosesn authored and jenkins committed May 15, 2018
    Problem
    
    Various tests were marked as flaky, some correctly, some incorrectly.
    
    Solution
    
    Unflaky everything!  After running this test 1000 times there were 0 failures.
    
    JIRA Issues: CSL-5888
    
    Differential Revision: https://phabricator.twitter.biz/D171344
Commits on May 5, 2018
  1. finagle-toggle: Make StandardToggleMap mutable

    mosesn authored and jenkins committed May 5, 2018
    Problem
    
    StandardToggleMap has an underlying mutable map, but it's difficult to access.
    
    Solution
    
    Make StandardToggleMap a `ToggleMap.Mutable` that proxies the mutating method
    to the underlying mutable map.
    
    JIRA Issues: CSL-6348
    
    Differential Revision: https://phabricator.twitter.biz/D167046
Commits on Apr 27, 2018
  1. finagle-toggle: Improve java compatibility

    mosesn authored and jenkins committed Apr 27, 2018
    Summary: Problem
    
    ToggleMap and Toggle found a bunch of java compatibility landmines.
    
    1. traits that extend abstract classes don't propagate their inheritance
    to java.
    2. methods that return generics with a primitive subtype are compiled
    as if they return an object subtype.  jdk8 disallowed casting from Gen<Object>
    to Gen<SpecificType>.
    3. PartialFunction[A, Boolean]#apply returns an Object instead of a boolean.
    
    Solution
    
    Add helpers to ToggleMap and Toggle to return a better type in java, and change
    everything that extends ToggleMap to be an abstract class.  For ToggleMap.Proxy,
    which is mixed in with other classes, we should instead change it to no longer
    extend ToggleMap, and instead have a self-type which conforms to ToggleMap.
    
    JIRA Issues: CSL-6325
    
    Differential Revision: https://phabricator.twitter.biz/D164489
Commits on Apr 26, 2018
  1. finagle-doc: Document our policy on nulls

    mosesn authored and jenkins committed Apr 26, 2018
    Summary: Problem
    
    Although it's clear to scala users of finagle that none of our APIs take nulls,
    some java users can be confused by this.
    
    Solution
    
    Document our policy on nulls in the FAQ.
    
    Differential Revision: https://phabricator.twitter.biz/D163810
Commits on Apr 18, 2018
  1. finagle-base-http: Provide Uri for doing URI things

    mosesn authored and jenkins committed Apr 18, 2018
    Summary: Problem
    
    The c.t.f.http.Request class has a hodge-podge of things on it, and it's often
    difficult to divine what the different pieces are doing.  As an example, the
    `Request#params` refer to things that don't come from the HTTP spec, URI query
    parameters and the application/x-www-form-urlencoded MIME-type.
    
    Solution
    
    Start breaking out the non-HTTP pieces of `c.t.f.http.Message` and friends so
    that in the long run we can slim down `c.t.f.http.Message` to something
    reasonable.
    
    Result
    
    It's now easy to extract the URI parameters as a ParamMap.
    
    JIRA Issues: CSL-6251
    
    Differential Revision: https://phabricator.twitter.biz/D160298
  2. finagle-http: Fix a flaky HTTP/2 test

    mosesn authored and jenkins committed Apr 18, 2018
    Summary: Problem / Solution
    
    Fixed a test to be consistent with the rest of the HTTP/2 tests so that we
    consistently upgrade before testing.
    
    JIRA Issues: CSL-6230
    
    Differential Revision: https://phabricator.twitter.biz/D160789
Commits on Apr 17, 2018
  1. finagle-http: Fix a metrics race condition

    mosesn authored and jenkins committed Apr 17, 2018
    Summary: Problem / Solution
    
    One of our HTTP/2 end to end tests is flaky because of a race between when
    we update some metrics and when we reset the metrics after the upgrade.
    
    JIRA Issues: CSL-6248
    
    Differential Revision: https://phabricator.twitter.biz/D159867
Commits on Apr 16, 2018
  1. finagle-integration: Unflaky DynamicTimeoutTest

    mosesn authored and jenkins committed Apr 16, 2018
    Summary: Problem / Solution
    
    DynamicTimeoutTest had a race in swapping out the transport in RefTransport that
    was fixed when we switched to upgrading only on messages without bodies.
    
    JIRA Issues: CSL-5979
    
    Differential Revision: https://phabricator.twitter.biz/D159801
Commits on Apr 4, 2018
  1. finagle-http2: Oversized headers result in TooLongMessageException

    mosesn authored and jenkins committed Apr 4, 2018
    Summary: Problem
    
    If the remote server returns a header list that's too big, we just swallow the
    error.  It would be better if we matched h1 behavior, which is to hand back
    a TooLongMessageException.
    
    Solution
    
    Whenever Http2ConnectionHandler#onStreamError is called with an
    HeaderListSizeException, match http/1.1 behavior by handing back a
    TooLongMessageException
    
    JIRA Issues: CSL-5810
    
    Differential Revision: https://phabricator.twitter.biz/D154113
Commits on Mar 7, 2018
  1. finagle-core: Make ClosedChannelExceptions implement FailureFlags

    mosesn authored and jenkins committed Mar 7, 2018
    Summary: Problem
    
    Sometimes ClosedChannelExceptions should be retryable.
    
    Solution
    
    Make them FailureFlags, which means that they can easily be marked Retryable.
    
    Also fixed a flaky test that started failing consistently.
    
    JIRA Issues: CSL-6113
    
    Differential Revision: https://phabricator.twitter.biz/D144740
Commits on Feb 27, 2018
  1. finagle: Change .travis.yml to use finagle-zipkin-scribe

    mosesn authored and jenkins committed Feb 27, 2018
    Summary: Problem / Solution
    
    We renamed finagle-zipkin to finagle-zipkin-scribe, but missed
    .travis.yml.
    
    JIRA Issues: CSL-6090
    
    Differential Revision: https://phabricator.twitter.biz/D142383
  2. finagle-zipkin-scribe: Renamed finagle-zipkin to finagle-zipkin-scribe

    mosesn authored and jenkins committed Feb 27, 2018
    Summary: Problem
    
    finagle-zipkin was originally named when scribe was the only transport
    for zipkin, so zipkin structs over scribe was the zipkin protocol. That's no
    longer the case--there are many different possible transports, and the
    openzipkin folks want to remove the scribe transport.
    
    Solution
    
    Rename finagle-zipkin to finagle-zipkin-scribe so it's clear it's just an
    implemenation, instead of the default.  This will discourage folks from adopting
    it by default.
    
    JIRA Issues: CSL-6090
    
    Differential Revision: https://phabricator.twitter.biz/D141940
Commits on Feb 14, 2018
  1. finagle: Remove finagle-netty3-http from the travisci build

    mosesn authored and jenkins committed Feb 14, 2018
    Summary: Problem / Solution
    
    The travisci build became misconfigured after we deleted finagle-netty3-http.
    
    JIRA Issues: CSL-6024
    
    Differential Revision: https://phabricator.twitter.biz/D138209
Commits on Feb 9, 2018
  1. finagle-http2: Stop closing the transport repeatedly.

    mosesn authored and jenkins committed Feb 9, 2018
    Summary: Problem
    
    We close the ChannelTransport many times on stream closure, which makes a bunch
    of new exceptions.  These exceptions have to walk the stack trace, so they have
    a performance impact.
    
    Solution
    
    1. Don't close the channel if channelInactive has been called on the channel.
    2. Don't allow two closes.
    3. Don't walk the stack when we make an exception when streams are closed.
    
    JIRA Issues: CSL-5882
    
    Differential Revision: https://phabricator.twitter.biz/D131457
Commits on Feb 8, 2018
  1. finagle-http2: Disable push promises

    mosesn authored and jenkins committed Feb 8, 2018
    Summary: Problem
    
    Our http/2 client doesn't support push promises, but it sometimes receives them
    from eager-beaver servers, and then barfs.  Barfing should never be the solution
    when the remote peer is following the spec.
    
    Solution
    
    Indicate in the initial http/2 settings that we disable server push.
    
    JIRA Issues: CSL-5958
    
    Differential Revision: https://phabricator.twitter.biz/D135151
Commits on Jan 26, 2018
  1. finagle-http: Rename the toggle and start again from 0%

    mosesn authored and jenkins committed Jan 26, 2018
    Summary: Problem
    
    The ping memory leaks make it untenable to keep using the old toggle name.
    
    Solution
    
    Let's switch to a new toggle, and split up the client and server toggles.
    
    JIRA Issues: CSL-5880
    
    Differential Revision: https://phabricator.twitter.biz/D130988
Commits on Jan 25, 2018
  1. finagle-http2: Don't get in an RST loop

    mosesn authored and jenkins committed Jan 25, 2018
    Summary: Problem
    
    We sometimes send an RST after we receive an RST, which is explicitly disallowed
    by the spec.  Although we don't seem to be getting into RST loops, it's possible
    if both the client and the server are badly behaved, so we should avoid having
    badly behaved clients.
    
    Solution
    
    Mark the transport as Dead so that it knows it doesn't need to RST.
    
    JIRA Issues: CSL-5879
    
    Differential Revision: https://phabricator.twitter.biz/D130963
Commits on Jan 24, 2018
  1. finagle-http2: Stop leaking streams on RST

    mosesn authored and jenkins committed Jan 24, 2018
    Summary: Problem
    
    We are leaking streams in the AdapterProxyChannelHandler when we send or receive
    an RST.
    
    Solution
    
    Make sure to tear down a stream when we send or receive an RST.  If there's a
    race and we later receive a message for a stream that has already received an
    RST, we drop the message.
    
    JIRA Issues: CSL-5872
    
    Differential Revision: https://phabricator.twitter.biz/D130464
Commits on Jan 19, 2018
  1. finagle-http: Fix disabling http/2, and make it easy to do

    mosesn authored and jenkins committed Jan 19, 2018
    Summary: Problem
    
    Right now, it's impossible to disable http/2 if it's toggled up.
    
    Solution
    
    Check if http/2 has been explicitly enabled or disabled, and ignore the toggle
    in that case.  I also made a helper method to make it easy to enable to disable
    HTTP/2.
    
    JIRA Issues: CSL-5809
    
    Differential Revision: https://phabricator.twitter.biz/D129068
Commits on Dec 17, 2017
  1. finagle-http2: Bump the default header list size

    mosesn authored and jenkins committed Dec 17, 2017
    Summary: Problem
    
    Folks see increased rates of 431s when migrating from http/1.1 to http/2.
    This seems to be because of a bug in netty which miscounts the size of headers
    by double counting header names.
    
    See netty/netty#7511.
    
    Solution
    
    The longterm fix is to fix netty, but the short term is to bump the max header
    list size.
    
    JIRA Issues: CSL-5725
    
    Differential Revision: https://phabricator.twitter.biz/D121912
Commits on Dec 13, 2017
  1. finagle-http2: Start supplying boringssl by default

    mosesn authored and jenkins committed Dec 13, 2017
    Summary: Problem
    
    http/2 users who are on JDK < 9 who want ALPN need to bring their own ALPN
    implementation.
    
    Solution
    
    Supply tcnative-boringssl with finagle-http2 by default.
    
    JIRA Issues: CSL-5393
    
    Differential Revision: https://phabricator.twitter.biz/D119562
  2. finagle-http2: Downgrade correctly with ALPN

    mosesn authored and jenkins committed Dec 13, 2017
    Summary: Problem
    
    Right now our ALPN downgrade drops the old connection on the ground and then
    makes a new http/1.1 connection
    
    Solution
    
    Instead of dropping the old connection on the ground, change the pipeline to
    http/1.1 and continue to use it.
    
    Result
    
    We no longer leak connections when the ALPN upgrade fails.
    
    JIRA Issues: CSL-5425
    
    Differential Revision: https://phabricator.twitter.biz/D118687
Commits on Dec 8, 2017
  1. finagle-http2: Strip more headers in more places

    mosesn authored and jenkins committed Dec 7, 2017
    Summary: Problem
    
    We aren't stripping the special header http2-settings from our http requests.
    This header should only exist for the upgrade request, and it isn't necessary
    after the upgrade has completed.
    
    Solution
    
    We should strip it, and we should generally santize both incoming and outgoing
    requests for both the client and the server.  I also split out the sanitization
    into its own channel handler, so it's a bit cleaner now.
    
    JIRA Issues: CSL-5644
    
    Differential Revision: https://phabricator.twitter.biz/D117676
Commits on Dec 1, 2017
  1. Revert "finagle: Remove `NackAdmissionFilter` from protocols without …

    mosesn authored and jenkins committed Dec 1, 2017
    …Nack support"
    
    Summary: This reverts the commit for PHAB_ID=D111722
    
    Differential Revision: https://phabricator.twitter.biz/D116539
Commits on Nov 29, 2017
  1. finagle-http2: Close connections properly in h2

    mosesn authored and jenkins committed Nov 29, 2017
    Summary: Problem
    
    Connections aren't being closed properly in http/2 when the client shuts down.
    
    Solution
    
    Propagate it all the way in AdapterProxyChannelHandler.
    
    JIRA Issues: CSL-5425
    
    Differential Revision: https://phabricator.twitter.biz/D111678
Commits on Nov 16, 2017
  1. csl: post-release mode oh yeah

    mosesn authored and jenkins committed Nov 16, 2017
Commits on Nov 15, 2017
  1. csl: Removed coursier to fix the build

    mosesn authored and jenkins committed Nov 15, 2017
    Summary: Problem
    
    There seems to be a bug with sbt 1.0.x, sbt-pgp, and coursier.
    See coursier/coursier#694
    
    Solution
    
    Stop using coursier to unblock publishing.
    
    JIRA Issues: CSL-5520
    
    Differential Revision: https://phabricator.twitter.biz/D112092