-
-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issues in BuildImage() #2626
Merged
Merged
Conversation
This file contains 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
The code already logs them so no need to return them all to the caller - the calling code will likely log them too. This will result in the same errors being logged twice. This is confusing for the user.
buildOptions.Context cannot be reused because it might have been partially consumed by the failed ImageBuild(). So, the next invocation will send a partial context, which will not work correctly.
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This ensures all resources are released properly.
mdelapenya
approved these changes
Jul 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
mdelapenya
added a commit
that referenced
this pull request
Jul 15, 2024
* main: fix: log output after context timeout (#2643) chore(deps): use "github.com/containerd/platforms" instead (#2638) chore(deps): bump google.golang.org/grpc to 1.64.1 (#2635) chore(deps): bump certifi from 2024.2.2 to 2024.7.4 (#2631) chore: prepare for next minor development cycle (0.33.0) chore: use new version (v0.32.0) in modules and examples feat: honour go toolchain's verbose flag to print out logs (#2624) Fix issues in BuildImage() (#2626) docs: indicate version for the Run function (#2627) chore: remove duplicated tests for config (#2628) Log retried errors (#2613)
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.
What does this PR do?
Please see individual commits. The most important fixes are to not reuse the
Context
and to close it to release resources.BuildOptions()
callsGetContext()
which callsarchive.TarWithOptions()
which starts a goroutine. This goroutine will be stuck until the reader is closed. So, current code leaks goroutines and open files whenBuildImage()
fails.Why is it important?
Improves reliability of image building.
Related issues