diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-24 23:23:28 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-26 09:26:11 +0000 |
commit | 9ee3fb95330003878fbd64b3ce8897aad96fcd0f (patch) | |
tree | c496bbe065872a76bdebc7c06f3e0ecf4539c7df /lib/bb/siggen.py | |
parent | 0e8421c41d97d5d50a553d70c8f775d521f1a199 (diff) | |
download | bitbake-9ee3fb95330003878fbd64b3ce8897aad96fcd0f.tar.gz |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/siggen.py')
-rw-r--r-- | lib/bb/siggen.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py index 96e16a45f..ff6b24ccd 100644 --- a/lib/bb/siggen.py +++ b/lib/bb/siggen.py @@ -156,6 +156,9 @@ class SignatureGenerator(object): return DataCacheProxy() + def exit(self): + return + class SignatureGeneratorBasic(SignatureGenerator): """ """ @@ -489,6 +492,12 @@ class SignatureGeneratorUniHashMixIn(object): self._client = hashserv.create_client(self.server) return self._client + def exit(self): + if getattr(self, '_client', None) is not None: + self._client.close() + self._client = None + return super().exit() + def get_stampfile_hash(self, tid): if tid in self.taskhash: # If a unique hash is reported, use it as the stampfile hash. This |