-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
stats, encoding: improve UUID-decoding error #136015
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
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.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @michae2, @mw5h, and @rytaft)
-- commits
line 5 at r1:
nit: the sentence seems incomplete.
pkg/util/encoding/encoding.go
line 3168 at r1 (raw file):
return b, uuid.UUID{}, errors.Errorf("invalid uuid length of %d", len(b)) } u, err = uuid.FromBytes(b[:uuidValueEncodedLength])
Nice! On a quick glance this seems like the only place in this file where we currently don't do bounds checks before slicing.
Add a length check to `DecodeUUIDValue` and a more informative error wrapping to `DecodeUpperBound`, which will hopefully help us track down the cause of cockroachdb#128876. The wrapped error message looks like: ``` decoding histogram version 3 type uuid value ‹666f6f›: invalid uuid length of 2 ``` Informs: cockroachdb#128876 Epic: None Release note: None
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.
TFYR!
bors r=yuzefovich
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @mw5h and @rytaft)
Previously, yuzefovich (Yahor Yuzefovich) wrote…
nit: the sentence seems incomplete.
oh, it was an issue number with a # symbol, lol. fixed
blathers backport 23.2 |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from 577f3e8 to blathers/backport-release-23.2-136015: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 23.2 failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Add a length check to
DecodeUUIDValue
and a more informative error wrapping toDecodeUpperBound
, which will hopefully help us track down the cause of #128876.The wrapped error message looks like:
Informs: #128876
Epic: None
Release note: None