]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: main: Alter EOFError handling
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 2 Jul 2019 10:56:31 +0000 (11:56 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 3 Jul 2019 16:00:57 +0000 (17:00 +0100)
If the server shuts down 'cleanly' due to some issue, the socket will close.
A recently reported example was an invalid PRSERV being set. Doing this silently
and without changing the retries count will case the server startup to loop
infinitely.

Change the code so it triggers the usual retries note messages and times
out eventually pointing the user at the cooker log file.

[YOCTO #12984]

(Bitbake rev: bb696636ef0c59f9e9640bb9460e7cce323cc785)

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

index a1226886c0d2872428e7f658337c88aff72e1fe0..3071141b55f71ccc042be5a60946277f1e1327dd 100755 (executable)
@@ -447,12 +447,7 @@ def setup_bitbake(configParams, configuration, extrafeatures=None):
                             bb.utils.unlockfile(lock)
                         raise bb.server.process.ProcessTimeout("Bitbake still shutting down as socket exists but no lock?")
                 if not configParams.server_only:
-                    try:
-                        server_connection = bb.server.process.connectProcessServer(sockname, featureset)
-                    except EOFError:
-                        # The server may have been shutting down but not closed the socket yet. If that happened,
-                        # ignore it.
-                        pass
+                    server_connection = bb.server.process.connectProcessServer(sockname, featureset)
 
                 if server_connection or configParams.server_only:
                     break
@@ -463,7 +458,7 @@ def setup_bitbake(configParams, configuration, extrafeatures=None):
                     raise
                 retries -= 1
                 tryno = 8 - retries
-                if isinstance(e, (bb.server.process.ProcessTimeout, BrokenPipeError)):
+                if isinstance(e, (bb.server.process.ProcessTimeout, BrokenPipeError, EOFError)):
                     logger.info("Retrying server connection (#%d)..." % tryno)
                 else:
                     logger.info("Retrying server connection (#%d)... (%s)" % (tryno, traceback.format_exc()))