Skip to content

sio/csupio: don't close underlying io.Reader - #7235

Open
nwt wants to merge 1 commit into
mainfrom
remove-close-from-csupio-reader
Open

sio/csupio: don't close underlying io.Reader#7235
nwt wants to merge 1 commit into
mainfrom
remove-close-from-csupio-reader

Conversation

@nwt

@nwt nwt commented Aug 22, 2026

Copy link
Copy Markdown
Member

If the io.Reader argument to NewReader implements io.Closer, then Reader.ConcurrentPull will close it at EOS. This can cause a panic if methods on vector.TypeValue instances are called that use TypeValue.loader because they rely on the reader. Fix that by removing the code that closes the underlying reader.

This aligns csupio.Reader behavior with that of the other sio.Reader implementations, none of which close their underlying reader. Closing them in a timely fashion rather than relying on the garbage collector to close them is future work.

If the io.Reader argument to NewReader implements io.Closer, then
Reader.ConcurrentPull will close it at EOS.  This can cause a panic if
methods on vector.TypeValue instances are called that use
TypeValue.loader because they rely on the reader.  Fix that by removing
the code that closes the underlying reader.

This aligns csupio.Reader behavior with that of the other sio.Reader
implementations, none of which close their underlying reader.  Closing
them in a timely fashion rather than relying on the garbage collector to
close them is future work.
@nwt
nwt requested a review from a team August 22, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants