-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Description
This issue is the same as #69880 but for regular a time.Timer
. The difference between a regular time.Timer
and a time.Ticker
is that it is much harder to reproduce the problem for a time.Timer
. The timer must be getting reset at just the right time, with a very low duration, so that it fires again. And this needs to happen 8 times.
The probability of this is very low, but it is possible to write code that causes this (though it's unclear if the code is useful). Slightly more concerning, however, is that there is an incredibly low chance of this just happening due to sheer luck.
I was basically only able to create a test for this that involves a timer that basically fires immediately (nanoseconds-long timer). Still, it is one additional possible problem.
Given that #69880 is fixed, fixing this isn't quite so important, but it turns out we can do so easily, to just close the door on this entirely.
It turns out that due to size class bumping from allocation headers, it costs us no extra memory to represent isSending
as an atomic.Int32
instead, so we can make the maximal number of concurrent timer firings something so absurdly large (2^31-1) that it will actually never happen.