summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server/process.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/server/process.py')
-rw-r--r--bitbake/lib/bb/server/process.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index f022b86c94..5fca3508b1 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -114,6 +114,10 @@ class ProcessServer(Process, BaseImplServer):
114 if self.quitout.poll(): 114 if self.quitout.poll():
115 self.quitout.recv() 115 self.quitout.recv()
116 self.quit = True 116 self.quit = True
117 try:
118 self.runCommand(["stateForceShutdown"])
119 except:
120 pass
117 121
118 self.idle_commands(.1, [self.command_channel, self.quitout]) 122 self.idle_commands(.1, [self.command_channel, self.quitout])
119 except Exception: 123 except Exception:
@@ -123,6 +127,7 @@ class ProcessServer(Process, BaseImplServer):
123 bb.event.unregister_UIHhandler(self.event_handle.value) 127 bb.event.unregister_UIHhandler(self.event_handle.value)
124 self.command_channel.close() 128 self.command_channel.close()
125 self.cooker.shutdown(True) 129 self.cooker.shutdown(True)
130 self.quitout.close()
126 131
127 def idle_commands(self, delay, fds=None): 132 def idle_commands(self, delay, fds=None):
128 nextsleep = delay 133 nextsleep = delay
@@ -172,12 +177,16 @@ class BitBakeProcessServerConnection(BitBakeBaseServerConnection):
172 self.event_queue = event_queue 177 self.event_queue = event_queue
173 self.connection = ServerCommunicator(self.ui_channel, self.procserver.event_handle, self.procserver) 178 self.connection = ServerCommunicator(self.ui_channel, self.procserver.event_handle, self.procserver)
174 self.events = self.event_queue 179 self.events = self.event_queue
180 self.terminated = False
175 181
176 def sigterm_terminate(self): 182 def sigterm_terminate(self):
177 bb.error("UI received SIGTERM") 183 bb.error("UI received SIGTERM")
178 self.terminate() 184 self.terminate()
179 185
180 def terminate(self): 186 def terminate(self):
187 if self.terminated:
188 return
189 self.terminated = True
181 def flushevents(): 190 def flushevents():
182 while True: 191 while True:
183 try: 192 try: