Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
io: fix MultiReader panic on nil reader.
The combination of two prior CLs can cause panics: * CL/17873: make chained multiReader Read more efficient * CL/28533: make MultiReader nil exhausted Readers for earlier GC The first CL allows MultiReader to "inherit" another MultiReader's list of Readers for efficiency reasons. This is problematic when combined with the later CL since that can set prior Readers in that list to nil for GC reasons. This causes panics when two MultiReaders are used together (even synchronously). To fix this, rather than setting consumed Readers as nil, we set them with a special eofReader that always returns EOF. Fixes #18232 Change-Id: I2a9357ab217e3d54d38ea9022d18e4d14f4182d3 Reviewed-on: https://go-review.googlesource.com/34140 Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
- Loading branch information