From: Ian Lance Taylor Date: Fri, 10 Jan 2020 18:10:32 +0000 (-0800) Subject: runtime: don't skip timer when adjustTimers sees a modified timer X-Git-Tag: go1.14rc1~128 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e6bbe967edef58073918ffd197e44d1559c90737;p=gostls13.git runtime: don't skip timer when adjustTimers sees a modified timer When adjustTimers sees a timerModifiedEarlier or timerModifiedLater, it removes it from the heap, leaving a new timer at that position in the heap. We were accidentally skipping that new timer in our loop. In some unlikely cases this could cause adjustTimers to look at more timers than necessary. Change-Id: Ic71e54c175ab7d86a7fa46f1497aca71ed1c43cc Reviewed-on: https://go-review.googlesource.com/c/go/+/214338 Run-TryBot: Ian Lance Taylor Reviewed-by: Michael Knyszek TryBot-Result: Gobot Gobot --- diff --git a/src/runtime/time.go b/src/runtime/time.go index d64bea814f..e0dfd6a5cd 100644 --- a/src/runtime/time.go +++ b/src/runtime/time.go @@ -669,6 +669,8 @@ func adjusttimers(pp *p) { return } } + // Look at this heap position again. + i-- } case timerNoStatus, timerRunning, timerRemoving, timerRemoved, timerMoving: badTimer()