mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-06 06:07:11 +02:00
[BUGFIX] PromQL: Noinline kahanSum, to avoid compiler optimisations
Observed on go1.24.4 darwin/arm64, the compensation variable is not correctly calculated. Note you may have to run the tests several times to see it, to get the right ordering of series. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
3602785a89
commit
358499f868
@ -1188,6 +1188,9 @@ func funcTimestamp(vals []parser.Value, _ parser.Expressions, enh *EvalNodeHelpe
|
||||
return enh.Out, nil
|
||||
}
|
||||
|
||||
// We get incorrect results if this function is inlined; see https://github.com/prometheus/prometheus/issues/16714.
|
||||
//
|
||||
//go:noinline
|
||||
func kahanSumInc(inc, sum, c float64) (newSum, newC float64) {
|
||||
t := sum + inc
|
||||
switch {
|
||||
|
Loading…
Reference in New Issue
Block a user