aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-16 09:17:10 -1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-16 23:03:09 +0100
commitd01d8326331cfe59208674cfc53aa26c0028b313 (patch)
tree7df6d760cdb5a345396ec1f00500ca53b4ad8a36 /lib/bb
parentb38a035cc8e769b5a4d8e49e55e3fb59fa6ea5d0 (diff)
downloadbitbake-d01d8326331cfe59208674cfc53aa26c0028b313.tar.gz
server/process: Disable gc around critical sectionyocto-3.3.62021-04.6-hardknott1.50.61.50
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> (cherry picked from commit 96a6303949cefd469bcf5ed250ff512271354357) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb')
-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 fcdce1971..b11c903e0 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -26,6 +26,7 @@ import errno
import re
import datetime
import pickle
+import gc
import bb.server.xmlrpcserver
from bb import daemonize
from multiprocessing import queues
@@ -737,8 +738,10 @@ class ConnectionWriter(object):
def send(self, obj):
obj = multiprocessing.reduction.ForkingPickler.dumps(obj)
+ gc.disable()
with self.wlock:
self.writer.send_bytes(obj)
+ gc.enable()
def fileno(self):
return self.writer.fileno()