]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: process: Ensure we call select() to know which fds to read
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 21 Aug 2017 20:26:52 +0000 (21:26 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 22 Aug 2017 18:50:25 +0000 (19:50 +0100)
There is an interesting bug in the current code where a sync command
is not seen until the current async command completes, by which time
the UI may have shut down.

The reason is that if there are idle commands, we may not end up sleeping
in the select call at all, partiularly under heavy load like parsing.

Fix this by calling select with a zero timeout so that we see active
fds and know to read from them. This fixes various problems toaster was
having with the recent server changes.

[YOCTO #11898]

(Bitbake rev: bbcce58e824b2793abf50efa52db158ae16e23e4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/server/process.py

index 2ebfdfc7e8c20957cf611fc4ff4a358ebd0241fb..3ab793c778055f2eedaa73e6cf54a4c646500386 100644 (file)
@@ -312,7 +312,7 @@ class ProcessServer(multiprocessing.Process):
                 # Ignore EINTR
                 return []
         else:
-            return []
+            return select.select(fds,[],[],0)[0]
 
 
 class ServerCommunicator():