Repository navigation
Conversation
…t archive ExtractGZIPFileToDir only handled io.EOF from tar.Reader.Next. Any other error (truncated or corrupted upload) left the header nil and the next line dereferenced it, panicking inside the errgroup goroutine and taking the whole agent down with the builds in progress.
Member
|
Consider applying #59 to have a automated release process |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ExtractGZIPFileToDir(used for the build context sent with a Containerfile deploy) only checksio.EOFfromtar.Reader.Next. A truncated or corrupted archive returns another error with a nil header, andh.FileInfo()panics:It runs inside the errgroup goroutine of
generateBuildLocalDirand the gRPC server has no recovery interceptor, so the panic kills the agent and every build running on it.What
ExtractTsuruAppFilesFromAppSourceContextuses.pkg/util/gzip_test.gowith a round trip test and a truncated archive test (panics on main).Tested with
go test -race ./pkg/util/.