Skip to contentSkip to conversation

server/process: Disable the flush() call in server logging

PATCH New Richard Purdie 1 participant 1 message Sep 14, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 server/process: Disable the flush() call in server logging

We've been chasing bitbake timeouts for a while and it was unclear where things were blocking on IO. It appears the flush() call in server logging can cause pauses up to minutes long on systems with slow (spinning) disks that are heavily loaded with IO.

Since the flush() was added to aid debugging of other timing issues, we shouldn't need it now and it can be disabled. Leave a comment as a reminder of the pain this can cause.

---
 lib/bb/server/process.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/bb/server/process.py +2 -1
index 40cb99bc97..94e93bc3a6 100644
@@ -43,7 +43,8 @@ def currenttime():
 
 def serverlog(msg):
     print(str(os.getpid()) + " " +  currenttime() + " " + msg)
-    sys.stdout.flush()
+    #Seems a flush here triggers filesytem sync like behaviour and long hangs in the server
+    #sys.stdout.flush()
 
 #
 # When we have lockfile issues, try and find infomation about which process is
Signature · 1 line
2.39.2