summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/siggen.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-24 23:23:28 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-26 09:27:43 +0000
commit88fcf8422dd04372d73aacfef0ee50de09ef41bd (patch)
tree2984b56895d81600650652d6c0bb704432396fb7 /bitbake/lib/bb/siggen.py
parenta10ac380b781073fc995a3ee245d570f7b49055d (diff)
downloadpoky-88fcf8422dd04372d73aacfef0ee50de09ef41bd.tar.gz
bitbake: cooker/siggen: Support exit calls and use for hashserv client
We have shutdown functions within the async client code but the siggen doesn't currently call them. We notice on python 3.10 (such as on fedora35) that at exit, there is a stray asyncio process left behind. Usually this doesn't cause problems but it could potentially be a cause of a hang. For general cleanliness and completness, add in hooks to call the exit handler. (Bitbake rev: 9ee3fb95330003878fbd64b3ce8897aad96fcd0f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/siggen.py')
-rw-r--r--bitbake/lib/bb/siggen.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 96e16a45f8..ff6b24ccda 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -156,6 +156,9 @@ class SignatureGenerator(object):
156 156
157 return DataCacheProxy() 157 return DataCacheProxy()
158 158
159 def exit(self):
160 return
161
159class SignatureGeneratorBasic(SignatureGenerator): 162class SignatureGeneratorBasic(SignatureGenerator):
160 """ 163 """
161 """ 164 """
@@ -489,6 +492,12 @@ class SignatureGeneratorUniHashMixIn(object):
489 self._client = hashserv.create_client(self.server) 492 self._client = hashserv.create_client(self.server)
490 return self._client 493 return self._client
491 494
495 def exit(self):
496 if getattr(self, '_client', None) is not None:
497 self._client.close()
498 self._client = None
499 return super().exit()
500
492 def get_stampfile_hash(self, tid): 501 def get_stampfile_hash(self, tid):
493 if tid in self.taskhash: 502 if tid in self.taskhash:
494 # If a unique hash is reported, use it as the stampfile hash. This 503 # If a unique hash is reported, use it as the stampfile hash. This