-
-
Notifications
You must be signed in to change notification settings - Fork 475
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: align header while log producers are reading #1085
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Hey @mdelapenya. This PR does not interfer with #947 in any way. Cheers, Dirk |
@Dirk007 I'm postponing the merge of this PR for two things on my side of the table:
I'd appreciate your patience while debugging 2) 🙏 |
ping ^^ |
🤦 thanks for the ping!!! Will make it to this PR today (currently working from a train, hopefully we have it in before arriving to my destination 😅 ) 🙏 |
Kudos, SonarCloud Quality Gate passed!
|
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!
@Dirk007 I'm merging this now, as I consider very difficult adding a test demonstrating the bug here. In any case, if you see it doable, let's do it in a follow-up PR 🤔 Thanks for your patience while contributing to testcontainers-go! |
Unless the Thanks for merging and have a good trip @mdelapenya ! |
* main: chore: support for bumping ryuk in an automated manner (testcontainers#1195) chore(deps): bump pymdown-extensions from 9.0 to 10.0 (testcontainers#1193) fix: align header while log producers are reading (testcontainers#1085) fix: update link to modules docs (testcontainers#1192) chore(deps): bump github.com/docker/distribution from 2.8.1+incompatible to 2.8.2+incompatible (testcontainers#1189)
What does this PR do?
This PR fixes a bug in the log handling because incomplete reads were ignored. Fixed by replacing
io.ReadCloser.Read()
withio.ReadFull()
to ensure that always a complete header and complete-log entries are read.Why is it important?
As
Read()
does not guarantee to read all the bytes requested, one unsuccessful read brought the header-handling out of sync so random headers were read consequently after ignoring that first one. As a result "random"-length log-entries were tried to read (with exceptional sizes) as well.TL;DR we must not ignore incomplete log-header reads.
Related issues
None