diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-02 09:46:22 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-03 17:51:26 +0100 |
commit | 496cbc01ca0ffd2b582b9ab4c4e0f54db7b18b00 (patch) | |
tree | 15e9ce62d7c415938dc9b2381da1f3db801f4458 /bitbake/lib/bb/server | |
parent | 70d6360602766232ca096ee427bb85564ac16a69 (diff) | |
download | poky-496cbc01ca0ffd2b582b9ab4c4e0f54db7b18b00.tar.gz |
bitbake: server/process: Disable gc around critical section
The python gc can trigger whilst we're holding the event stream lock
and when cleaning up objects, they can trigger warnings. This translates
into a new event which would then need the lock and we can deadlock.
Disable gc whilst we hold that lock to avoid this unfortunate and
problematic situation.
(Bitbake rev: 96a6303949cefd469bcf5ed250ff512271354357)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/server')
-rw-r--r-- | bitbake/lib/bb/server/process.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index ce53fdc678..19ef83980f 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
@@ -28,6 +28,7 @@ import re | |||
28 | import datetime | 28 | import datetime |
29 | import pickle | 29 | import pickle |
30 | import traceback | 30 | import traceback |
31 | import gc | ||
31 | import bb.server.xmlrpcserver | 32 | import bb.server.xmlrpcserver |
32 | from bb import daemonize | 33 | from bb import daemonize |
33 | from multiprocessing import queues | 34 | from multiprocessing import queues |
@@ -739,8 +740,10 @@ class ConnectionWriter(object): | |||
739 | self.event = self | 740 | self.event = self |
740 | 741 | ||
741 | def _send(self, obj): | 742 | def _send(self, obj): |
743 | gc.disable() | ||
742 | with self.wlock: | 744 | with self.wlock: |
743 | self.writer.send_bytes(obj) | 745 | self.writer.send_bytes(obj) |
746 | gc.enable() | ||
744 | 747 | ||
745 | def send(self, obj): | 748 | def send(self, obj): |
746 | obj = multiprocessing.reduction.ForkingPickler.dumps(obj) | 749 | obj = multiprocessing.reduction.ForkingPickler.dumps(obj) |