• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yarpc / yarpc-go / 5284

Build:
DEFAULT BRANCH: master
Ran 30 Mar 2017 01:53AM UTC
Jobs 1
Files 165
Run time 8s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
5284

Pull #861

travis-ci

web-flow
thrift: Disable buffer pooling

This stops the Thrift encoding from pooling buffers because currently
the buffers are returned to the pool before their lifetime is over.
This is because lists, sets and maps in ThriftRW's `wire.Value`s are
lazy; they don't attempt to deserialize until the contents are
requested, which happens when the generic `wire.Value` representation is
converted into generated types using `FromWire`.

To help visualize this,

    // YARPC defines a function that returns a wire.Value, using a
    // pooled buffer during deserialization.
    func Call() wire.Value {
        buf := buffer.Get()
        defer buffer.Put(buf)

        value := decode(buf)
        return value
    }

    // The generated client calls into YARPC to get the decoded
    // wire.Value. It then deserializes the wire.Value into the
    // generated MyType.
    func MyCall() MyType {
        value := yarpc.Call()

        var x MyType
        x.FromWire(value)  -----
        return x
    }

    // MyType contains a list of some other type which it reads from the
    // wire.Value lazy list.
    FromWire(v wire.Value) {
        v.GetList().ForEach(func(item wire.Value) {
            appendToSelf(...)
        })
    }

    // The lazy list now attempts to decode the items from the list into
    // wire.Values on demand, starting at the position it previously
    // recorded.
    func ForEach(f func(wire.Value)) {
        for i := 0; i < length; i++ {
            value := decodeAt(startingPosition)
            f(value)
        }
    }

By the time we get to FromWire, we have already returned the buffer to
the pool so anything ForEach reads from the buffer is now wrong.
Pull Request #861: thrift: Disable buffer pooling

7732 of 9563 relevant lines covered (80.85%)

37.9 hits per line

Jobs
ID Job ID Ran Files Coverage
6 5284.6 (TYPE=test) 30 Mar 2017 01:53AM UTC 0
80.85
Travis Job 5284.6
Source Files on build 5284
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #5284
  • Pull Request #861
  • PR Base - master (#4752)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc