diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-16 09:17:10 -1000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-16 23:02:05 +0100 |
commit | 70ea322a4866f7ef20361a6b146f2be568261c6a (patch) | |
tree | ad421b44156b81227dba44a61ea2eb086312c0ae | |
parent | 2d4cc6c4e75d0176d09dd30fbf209b3ed271ffb5 (diff) | |
download | bitbake-70ea322a4866f7ef20361a6b146f2be568261c6a.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>
(cherry picked from commit 96a6303949cefd469bcf5ed250ff512271354357)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/server/process.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py index 8fdcc66dc..91c463752 100644 --- a/lib/bb/server/process.py +++ b/lib/bb/server/process.py @@ -27,6 +27,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): 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() |