mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
After golang 1.23 it's safe to ignore timer.Reset True value. According to the spec: For a chan-based timer created with NewTimer, as of Go 1.23, any receive from t.C after Reset has returned is guaranteed not to receive a time value corresponding to the previous timer settings; If the program has not received from t.C already and the timer is running, Reset is guaranteed to return true. Before Go 1.23, the only safe way to use Reset was to call [Timer.Stop] and explicitly drain the timer first. Golang 1.23 changed timer implementation from sync and async. And it made possible that chan send and timer.Stop could happen in the same time. Fixes https://github.com/VictoriaMetrics/VictoriaMetrics/issues/9721
625 B
625 B