Joshua Watt <[email protected]> escreveu no dia sábado, 16/10/2021 à(s) 20:15:
> > > On Fri, Oct 15, 2021, 6:47 PM Jose Quaresma <[email protected]> > wrote: > >> When the user specify an upstream hash equivalence server in >> BB_HASHSERVE_UPSTREAM abort if we can't connect otherwise the >> user will never be notified about the problem. >> >> Signed-off-by: Jose Quaresma <[email protected]> >> --- >> bitbake/lib/bb/cooker.py | 12 +++++++++++- >> 1 file changed, 11 insertions(+), 1 deletion(-) >> >> diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py >> index af794b4c42..34603c5ea2 100644 >> --- a/bitbake/lib/bb/cooker.py >> +++ b/bitbake/lib/bb/cooker.py >> @@ -388,12 +388,22 @@ class BBCooker: >> # Create a new hash server bound to a unix domain socket >> if not self.hashserv: >> dbfile = (self.data.getVar("PERSISTENT_DIR") or >> self.data.getVar("CACHE")) + "/hashserv.db" >> + upstream = self.data.getVar("BB_HASHSERVE_UPSTREAM") or >> None >> + if upstream: >> + import socket >> + try: >> + sock = >> socket.create_connection(upstream.split(":"), 5) >> + sock.close() >> + except socket.error as e: >> + bb.fatal("BB_HASHSERVE_UPSTREAM is not valid, >> unable to connect hash equivalence server at '%s': %s" >> + % (upstream, repr(e))) >> + >> > > Perhaps this should just be a warning? The upstream missing should not be > fatal for a given server, if it is we probably need to fix that > In my opinion this needs to be fatal or fixed with a different approach. If we launch bitbake in a clean build without build/cache with an invalid server it will deadlock printing the follow message after several minutes: WARNING: Error contacting Hash Equivalence Server unix:///build/hashserve.sock: Connection closed The build/bitbake-cookerdaemon.log have all the connections errors as well as exceptions. This cooker log is a bit ugly imho and I will try to improved it in a follow up patch. > self.hashservaddr = "unix://%s/hashserve.sock" % >> self.data.getVar("TOPDIR") >> self.hashserv = hashserv.create_server( >> self.hashservaddr, >> dbfile, >> sync=False, >> - upstream=self.data.getVar("BB_HASHSERVE_UPSTREAM") >> or None, >> + upstream=upstream, >> ) >> self.hashserv.serve_as_process() >> self.data.setVar("BB_HASHSERVE", self.hashservaddr) >> -- >> 2.33.1 >> >> >> >> >> -- Best regards, José Quaresma
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#157046): https://lists.openembedded.org/g/openembedded-core/message/157046 Mute This Topic: https://lists.openembedded.org/mt/86362510/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
