Uh oh!
There was an error while loading. Please reload this page.
Tar: Improve unseekable stream handling - #84279
Conversation
ghost
commented
Apr 4, 2023
Tagging subscribers to this area: @dotnet/area-system-formats-tar Issue DetailsFixes #76690 Addresses the issue reported in dotnet/sdk-container-builds#192 (comment) by @rainersigwald Before this change, it wasn't possible to write into an archive a file entry that contained an unseekable data stream. The undelying cause was that we were calling The way I fixed this was by separating the code that writes an entry into two possible paths:
|
I'll remove the new file |
adamsitnik
left a comment
There was a problem hiding this comment.
Overall it LGTM, but it would be nice if we could reduce the code duplication before merging.
Thank you @carlossanlop !
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Adjust existing unseekable stream tests to verify correct for all formats and with multiple tar entries.
… stream into an unseekable archive stream.
… Add extra debug asserts.
adamsitnik
left a comment
There was a problem hiding this comment.
LGTM, please apply my suggestions before merging.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
carlossanlop
commented
Jun 1, 2023
Failures are unrelated. |
Fixes#76690
Addresses the issue reported in dotnet/sdk-container-builds#192 (comment) by @rainersigwald
Before this change, it wasn't possible to write into an archive a file entry that contained an unseekable data stream. The undelying cause was that we were calling
Lengthto try to get the total number of bytes of the data stream, but it is unsupported when the stream'sCanSeekisfalse.The way I fixed this was by separating the code that writes an entry into two possible paths:
One path for entries with seekable data streams, which remains mostly unmodified.
A new path for entries with unseekable streams, which changes the order in which we collect the entry information into the buffer: