Repository navigation
Fixes
- An unused round tripper no longer holds a stream for good.
- The bug:
NewRoundTripperconfirms its connection before returning, and that connection holds one of the session's streams until a request takes it. A round tripper discarded unused, as a race does when another transport wins, kept its stream open. Open streams kept the session from looking idle, so it was never retired. OnceMaxStreams(64 by default) had leaked, every dial failed withsoar: too many streamsuntil the process restarted. - Impact: one Windows client on a Lantern beta failed every Soar attempt about 1,800 times over two days. It was losing short races to Unbounded's signaling polls, which run every ~14 s.
- The fix: the returned transport implements
io.Closer.Closereleases an untaken connection and closes idle connections. An untaken connection also closes itself after 10 s, for callers that never callClose. (#15)
- The bug:
- getlantern/kindling#61 makes kindling's race close the round trippers it doesn't use. Either fix alone stops this leak.
Compatibility
There are no API changes: NewRoundTripper still returns an http.RoundTripper, which can now also be asserted to io.Closer. The wire protocol is unchanged: v0.2.4 interoperates with v0.2.x, v0.1.0 and soar-rs clients and servers. soar-rs needs no matching change, since its connections close their streams when dropped.
Full changelog: v0.2.3...v0.2.4