summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-02 09:46:22 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-03 17:51:26 +0100
commit496cbc01ca0ffd2b582b9ab4c4e0f54db7b18b00 (patch)
tree15e9ce62d7c415938dc9b2381da1f3db801f4458 /bitbake/lib/bb/server
parent70d6360602766232ca096ee427bb85564ac16a69 (diff)
downloadpoky-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.py3
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
28import datetime 28import datetime
29import pickle 29import pickle
30import traceback 30import traceback
31import gc
31import bb.server.xmlrpcserver 32import bb.server.xmlrpcserver
32from bb import daemonize 33from bb import daemonize
33from multiprocessing import queues 34from 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)