[bitbake-devel] [WIP][RFC PATCH 4/5] bitbake: main: handle BB_SERVER_TIMEOUT = -1

Robert Yang liezhi.yang at windriver.com
Tue Aug 8 09:12:08 UTC 2017


Make BB_SERVER_TIMEOUT = -1 mean no unload forever.

Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
 bitbake/lib/bb/main.py           | 6 ++++--
 bitbake/lib/bb/server/process.py | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py
index fb082e7e0f3..57b4d7688d9 100755
--- a/bitbake/lib/bb/main.py
+++ b/bitbake/lib/bb/main.py
@@ -259,8 +259,10 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
                           help="The name/address for the bitbake xmlrpc server to bind to.")
 
         parser.add_option("-T", "--idle-timeout", type=float, dest="server_timeout",
-                          default=os.environ.get("BB_SERVER_TIMEOUT", 0) or None,
-                          help="Set timeout to unload bitbake server due to inactivity")
+                          default=os.getenv("BB_SERVER_TIMEOUT"),
+                          help="Set timeout to unload bitbake server due to inactivity, "
+                                "set to -1 means no unload, "
+                                "default: Environment variable BB_SERVER_TIMEOUT.")
 
         parser.add_option("", "--no-setscene", action="store_true",
                           dest="nosetscene", default=False,
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index 5b8a549f94e..338c44835e1 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -180,7 +180,8 @@ class ProcessServer(multiprocessing.Process):
                     if self.timeout is None:
                         print("No timeout, exiting.")
                         self.quit = True
-            if not self.haveui and self.lastui and self.timeout and (self.lastui + self.timeout) < time.time():
+            if not self.timeout == -1.0 and not self.haveui and self.lastui and self.timeout and \
+                    (self.lastui + self.timeout) < time.time():
                 print("Server timeout, exiting.")
                 self.quit = True
 
-- 
2.11.0




More information about the bitbake-devel mailing list