Skip to content
Snippets Groups Projects
Commit eee9fba7 authored by Richard Purdie's avatar Richard Purdie
Browse files

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: d01d8326331cfe59208674cfc53aa26c0028b313)

Signed-off-by: default avatarRichard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 96a6303949cefd469bcf5ed250ff512271354357)
Signed-off-by: default avatarSteve Sakoman <steve@sakoman.com>
Signed-off-by: default avatarRichard Purdie <richard.purdie@linuxfoundation.org>
parent 52645c86
Branches
No related merge requests found
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment