-
Notifications
You must be signed in to change notification settings - Fork 795
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
client.FromLabelAdaptersToLabels breaks contract of labels.Labels
#1813
Comments
There's various other ways to resolve this - could comment that it doesn't check that contact, or comment that it must only be called with sorted Could you say a bit about where this caused a problem? |
Yes, documenting break of contract or required preconditions is one way of fixing it. I'm not sure if it is a problem in Cortex (on quick check, it doesn't seem to be), but I've found several unsafe usages in Loki. |
Same problem in cortex/pkg/storage/tsdb/labels.go Line 14 in 5bd771f
|
@pstibrany May you elaborate a bit more on the issue, please? |
This is exactly the problem. |
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
There is now a comment on the function warning about this behavior. |
cortex/pkg/ingester/client/compat.go
Line 193 in fab5ced
labels.Labels
is supposed to be sorted set of labels. Conversion from[]LabelAdapter
is unsafe unless order is checked first.The text was updated successfully, but these errors were encountered: