bitbake: cooker: Fix exit handling issues

The shutdown() call should definitely not be waiting for idle, since we
expect execution and events to continue even after setting either shutdown
state. This was causing the UI to appear to hang at Ctrl+C interrupts.

Also ensure that if we reset cooker, we stop any active parser processes
since these currently appear to be being left behind.

(Bitbake rev: 4f73c2eb12ee074f3b7d4717380649f6ca8f3def)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2023-01-11 17:14:04 +00:00
parent 3a439f94ab
commit 51f7321141

View File

@@ -1743,7 +1743,7 @@ class BBCooker:
return
def post_serve(self):
self.shutdown(force=True, idle=False)
self.shutdown(force=True)
prserv.serv.auto_shutdown()
if hasattr(bb.parse, "siggen"):
bb.parse.siggen.exit()
@@ -1753,17 +1753,14 @@ class BBCooker:
if hasattr(self, "data"):
bb.event.fire(CookerExit(), self.data)
def shutdown(self, force=False, idle=True):
def shutdown(self, force=False):
if force:
self.state = state.forceshutdown
else:
self.state = state.shutdown
if idle:
self.waitIdle(30)
if self.parser:
self.parser.shutdown(clean=not force)
self.parser.shutdown(clean=False)
self.parser.final_cleanup()
def finishcommand(self):
@@ -1775,6 +1772,7 @@ class BBCooker:
def reset(self):
if hasattr(bb.parse, "siggen"):
bb.parse.siggen.exit()
self.finishcommand()
self.initConfigurationData()
self.handlePRServ()