Skip to content

data_source: snapshot readers so Append can reload - #404

Closed
team-humaki wants to merge 1 commit into
go-ini:v1from
team-humaki:data-source-snapshot-readers
Closed

team-humaki wants to merge 1 commit into
go-ini:v1from
team-humaki:data-source-snapshot-readers

Conversation

@team-humaki

Copy link
Copy Markdown

Append stored io.Reader / ReadCloser sources as-is, then Reload closed them. A second Append (or Reload) failed with "file already closed" because those streams are not rewindable.

Read the bytes once when the source is ingested and keep a sourceData snapshot so later reloads can re-read. Fixes #324.

unknwon commented Nov 11, 2026

Copy link
Copy Markdown
Member

Thanks. Reading every reader up front keeps a copy of it for the life of the File, and it breaks ShortCircuit, which used to skip later sources: a reader after the first source that errors or blocks now fails or hangs Load. I'd prefer skipping sources that can't be read again on reload.

@unknwon unknwon closed this Nov 11, 2026
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.

Append() get file already closed when trying to append a second io.Reader

2 participants