You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
checkMetricConsistency relies on labels being sorted. If they are not, it is sorting them, which is modifying a slice that is assumed to be immutable elsewhere. Even if they are sorted, sort.Sort might temporarily change order (even if no equal elements are in the slice) if there are more than 12 labels (where the implementation switches from ShellSort to HeapSort or QuickSort).
Just using sort.Stable is not a solution as the immutable slice will still be mutated if it is not sorted (which can only happen with home-grown metric families, but it can still happen).
See #511 for discussion . Thanks to @douglas-reid for identifying the bug and its cause.
The text was updated successfully, but these errors were encountered:
checkMetricConsistency
relies on labels being sorted. If they are not, it is sorting them, which is modifying a slice that is assumed to be immutable elsewhere. Even if they are sorted,sort.Sort
might temporarily change order (even if no equal elements are in the slice) if there are more than 12 labels (where the implementation switches from ShellSort to HeapSort or QuickSort).Just using
sort.Stable
is not a solution as the immutable slice will still be mutated if it is not sorted (which can only happen with home-grown metric families, but it can still happen).See #511 for discussion . Thanks to @douglas-reid for identifying the bug and its cause.
The text was updated successfully, but these errors were encountered: