aboutsummaryrefslogtreecommitdiffstats
path: root/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:18 +0100
commit96a6303949cefd469bcf5ed250ff512271354357 (patch)
tree49c282046cd21e206431cb3223234037d5619dc6 /lib/bb/server
parent6aecc2fe51a52020f6f13be08449e18d42e7a6b5 (diff)
downloadbitbake-96a6303949cefd469bcf5ed250ff512271354357.tar.gz
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/server')
-rw-r--r--lib/bb/server/process.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index ce53fdc67..19ef83980 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -28,6 +28,7 @@ import re
import datetime
import pickle
import traceback
+import gc
import bb.server.xmlrpcserver
from bb import daemonize
from multiprocessing import queues
@@ -739,8 +740,10 @@ class ConnectionWriter(object):
self.event = self
def _send(self, obj):
+ gc.disable()
with self.wlock:
self.writer.send_bytes(obj)
+ gc.enable()
def send(self, obj):
obj = multiprocessing.reduction.ForkingPickler.dumps(obj)