summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-12 23:05:01 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-13 08:07:00 +0100
commit2976f43c22ed2615c2efe63e4b6676639eab5428 (patch)
tree88dfe22d8c82faf16f366c3e8bb0265426c68c27 /bitbake
parentb4919c7ad70a4c293c4e4431f6faaeedf09501ba (diff)
downloadpoky-2976f43c22ed2615c2efe63e4b6676639eab5428.tar.gz
bitbake: server/process: Add extra logfile flushing
There is the possibility data is being lost from the logfile due to data buffering. Add in a couple of extra flush calls to ensure data is being written out before the lock file is dropped. Possible fix for [YOCTO #14000]? (Bitbake rev: 596ea229a87d26a8e970c7ee77179519ad081fef) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/server/process.py35
1 files changed, 22 insertions, 13 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index 7ee427b51c..65e1eab527 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -247,6 +247,10 @@ class ProcessServer():
247 247
248 self.cooker.post_serve() 248 self.cooker.post_serve()
249 249
250 # Flush logs before we release the lock
251 sys.stdout.flush()
252 sys.stderr.flush()
253
250 # Finally release the lockfile but warn about other processes holding it open 254 # Finally release the lockfile but warn about other processes holding it open
251 lock = self.bitbake_lock 255 lock = self.bitbake_lock
252 lockfile = lock.name 256 lockfile = lock.name
@@ -469,20 +473,25 @@ class BitBakeServer(object):
469 print(self.start_log_format % (os.getpid(), datetime.datetime.now().strftime(self.start_log_datetime_format))) 473 print(self.start_log_format % (os.getpid(), datetime.datetime.now().strftime(self.start_log_datetime_format)))
470 sys.stdout.flush() 474 sys.stdout.flush()
471 475
472 server = ProcessServer(self.bitbake_lock, self.sock, self.sockname, self.configuration.server_timeout, self.configuration.xmlrpcinterface)
473 os.close(self.readypipe)
474 writer = ConnectionWriter(self.readypipein)
475 try: 476 try:
476 self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset, server.register_idle_function) 477 server = ProcessServer(self.bitbake_lock, self.sock, self.sockname, self.configuration.server_timeout, self.configuration.xmlrpcinterface)
477 except bb.BBHandledException: 478 os.close(self.readypipe)
478 return None 479 writer = ConnectionWriter(self.readypipein)
479 writer.send("r") 480 try:
480 writer.close() 481 self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset, server.register_idle_function)
481 server.cooker = self.cooker 482 except bb.BBHandledException:
482 print("Started bitbake server pid %d" % os.getpid()) 483 return None
483 sys.stdout.flush() 484 writer.send("r")
484 485 writer.close()
485 server.run() 486 server.cooker = self.cooker
487 print("Started bitbake server pid %d" % os.getpid())
488 sys.stdout.flush()
489
490 server.run()
491 finally:
492 # Flush any ,essages/errors to the logfile before exit
493 sys.stdout.flush()
494 sys.stderr.flush()
486 495
487def connectProcessServer(sockname, featureset): 496def connectProcessServer(sockname, featureset):
488 # Connect to socket 497 # Connect to socket