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

yarpc / yarpc-go / 5287

Build:
DEFAULT BRANCH: master
Ran 30 Mar 2017 02:01AM UTC
Jobs 2
Files 165
Run time 16min
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
5287

push

travis-ci

web-flow
thrift: Disable buffer pooling (#861)

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.

7732 of 9563 relevant lines covered (80.85%)

76.51 hits per line

Jobs
ID Job ID Ran Files Coverage
4 5287.4 (TYPE=test) 30 Mar 2017 02:01AM UTC 0
80.67
Travis Job 5287.4
6 5287.6 (TYPE=test) 30 Mar 2017 02:17AM UTC 0
80.85
Travis Job 5287.6
Source Files on build 5287
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #5287
  • 56957e1a on github
  • Prev Build on master (#4752)
  • Next Build on master (#5289)
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

© 2025 Coveralls, Inc