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 belopolsky, eryksun, lunixbochs2, p-ganssle, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2021-06-14.09:15:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1623662147.78.0.0807709580249.issue44328@roundup.psfhosted.org>
In-reply-to
Content
> It shouldn't behave drastically different just because the user closed the laptop lid for an hour

I talked to someone who's been helping with the Go time APIs and it seems like that holds pretty well for interactive timeouts, but makes no sense for network related code. If you lost a network connection (with, say, a 30 second timeout) due to the lid being closed, you don't want to wait 30 seconds after opening the lid for the application to realize it needs to reconnect. (However there's probably no good way to design Python's locking system around both cases, so it's sufficient to say "lock timers won't advance during suspend" and make the application layer work around that on its own in the case of network code)

> Try changing EnterNonRecursiveMutex() to break out of the loop in this case

This does work, but unfortunately a little too well - in a single test I saw several instances where that approach returned _earlier_ than the timeout.

I assume the reason for this loop is the call can get interrupted with a "needs retry" state. If so, you'd still see 16ms of jitter anytime that happens as long as it's backed by a quantized time source.
History
Date User Action Args
2021-06-14 09:15:47lunixbochs2setrecipients: + lunixbochs2, paul.moore, belopolsky, vstinner, tim.golden, zach.ware, eryksun, steve.dower, p-ganssle
2021-06-14 09:15:47lunixbochs2setmessageid: <1623662147.78.0.0807709580249.issue44328@roundup.psfhosted.org>
2021-06-14 09:15:47lunixbochs2linkissue44328 messages
2021-06-14 09:15:47lunixbochs2create