From 496cbc01ca0ffd2b582b9ab4c4e0f54db7b18b00 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 2 Apr 2022 09:46:22 +0100 Subject: 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 --- bitbake/lib/bb/server/process.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bitbake/lib') 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 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) -- cgit v1.2.3-54-g00ecf