-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Fix strange code, add messages to code brought in #8106 #13509
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
Conversation
077dcaf
to
284f086
Compare
Signed-off-by: Mikhail Fesenko <proggga@gmail.com>
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.
Thanks for fixing it. I'm very surprised no test failed for this bug, which would have caused a corruption. I wouldn't block this PR until we get a test (cause merging this fix look high priority to me), but we should really get one.
Prob it works because it resets buffer but not sure, I'll try to add some tests here today evening |
Uhm, not sure. The |
Agree, so I'm kinda not sure how it passed this test |
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 for the fix! As marco said too bad a test did not catch this. If you are willing to add another PR for the test that would be awesome
I think I may have understood why no test was failing. The length was written twice, but both times at the same position, overwriting the |
Ah looks like you're right, it does w.write ... startPos, the same pos to write, so it re-write over and doesn't break anything, just writing 2 times |
Even the written length should have been correct, because |
Can you please point me in doc, becuase I can't find any piece of doc saying about updateing position. Just need that to learn |
My reasoning:
|
i see, interesting |
Postmortem: |
Thanks both for caring about this so much 👍 |
…ometheus#13509) Signed-off-by: Mikhail Fesenko <proggga@gmail.com>
3-4 years ago I did a change for hackaton and today it was merged #8106 . I realized that I extracted method but in one place I extracted only half of function. Not sure this is good for code so I did a second PR (this) and added error messages because in any issues it will be hard to debug