This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lunixbochs2
Recipients Dennis Sweeney, SD, eryksun, lunixbochs2, miss-islington, ned.deily, paul.moore, pitrou, steve.dower, tim.golden, vstinner, zach.ware
Date 2021-06-14.07:43:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1623656596.79.0.167605121245.issue41299@roundup.psfhosted.org>
In-reply-to
Content
I agree with not throwing fatal errors, but that check is unlikely to actually be hit, and you removed the startup checks covering the underlying clocks here: https://github.com/python/cpython/commit/ae6cd7cfdab0599139002c526953d907696d9eef

I think if the time source is broken, a user would probably prefer an exception or fatal error to the deadlock they will otherwise get (as time not advancing means it's impossible to timeout), so it doesn't make sense to remove the check without doing something else about it.

There are three places win_perf_counter_frequency() can fail: https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Python/pytime.c#L974

I mention the QueryPerformanceFrequency error case here (stack misalignment): https://bugs.python.org/issue41299#msg395237

The other option, besides startup checks, would be to better parameterize the timer used (mentioned in bpo-44328): Prefer QueryUnbiasedInterruptTimePrecise if available (Win 10+ via GetProcAddress), then QPC, then QueryUnbiasedInterruptTime (which has the original bug wrt jitter but should never be used as QPC is unlikely to be broken).
History
Date User Action Args
2021-06-14 07:43:16lunixbochs2setrecipients: + lunixbochs2, paul.moore, pitrou, vstinner, tim.golden, ned.deily, zach.ware, eryksun, steve.dower, miss-islington, Dennis Sweeney, SD
2021-06-14 07:43:16lunixbochs2setmessageid: <1623656596.79.0.167605121245.issue41299@roundup.psfhosted.org>
2021-06-14 07:43:16lunixbochs2linkissue41299 messages
2021-06-14 07:43:16lunixbochs2create