mirror of
https://git.yoctoproject.org/poky
synced 2026-05-04 13:39:49 +02:00
bitbake: cooker: Handle SIGTERM more gracefully
If the cooker receives a SIGTERM it currently hangs using 100% CPU, This patch adds in an intercept for the event and puts the cooker into shutdown mode allowing it to exit cleanly/safely and avoiding the hang. (Bitbake rev: 00c22434123739b0819b31d7b1d353901a3e12da) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -37,6 +37,7 @@ from collections import defaultdict
|
||||
import bb, bb.exceptions, bb.command
|
||||
from bb import utils, data, parse, event, cache, providers, taskdata, runqueue
|
||||
import Queue
|
||||
import signal
|
||||
import prserv.serv
|
||||
|
||||
logger = logging.getLogger("BitBake")
|
||||
@@ -149,6 +150,12 @@ class BBCooker:
|
||||
|
||||
self.parser = None
|
||||
|
||||
signal.signal(signal.SIGTERM, self.sigterm_exception)
|
||||
|
||||
def sigterm_exception(self, signum, stackframe):
|
||||
bb.warn("Cooker recieved SIGTERM, shutting down...")
|
||||
self.state = state.forceshutdown
|
||||
|
||||
def setFeatures(self, features):
|
||||
original_featureset = list(self.featureset)
|
||||
for feature in features:
|
||||
|
||||
Reference in New Issue
Block a user