[hacking] N374 do not use time.sleep(0) to yield

We have a centralized nova.utils.cooperative_yield() instead of
time.sleep(0). It is better as it allows to turn off the sleep calls
when the service runs in threaded mode.

Change-Id: I625daec79ee5b7f8b92116f450e21f997cef0546
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
This commit is contained in:
Balazs Gibizer
2025-05-27 15:20:34 +02:00
parent 858494997e
commit d265faed2c
5 changed files with 35 additions and 2 deletions
+2
View File
@@ -79,6 +79,8 @@ Nova Specific Commandments
- [N372] Don't use the setDaemon method. Use the daemon attribute instead.
- [N373] Don't use eventlet specific concurrency primitives. Use the one
from stdlib instead. E.g. eventlet.sleep => time.sleep
- [N374] Don't use time.sleep(0) to trigger eventlet yielding.
Use nova.utils.cooperative_yield() instead.
Creating Unit Tests
-------------------