##// END OF EJS Templates
Rename wait_shutdown to finish_shutdown
Thomas Kluyver -
Show More
@@ -259,15 +259,15 b' class KernelManager(LoggingConfigurable, ConnectionFileMixin):'
259 259 msg = self.session.msg("shutdown_request", content=content)
260 260 self.session.send(self._control_socket, msg)
261 261
262 def wait_shutdown(self, totaltime=1, interval=0.1):
262 def finish_shutdown(self, waittime=1, pollinterval=0.1):
263 263 """Wait for kernel shutdown, then kill process if it doesn't shutdown.
264 264
265 265 This does not send shutdown requests - use :meth:`request_shutdown`
266 266 first.
267 267 """
268 for i in range(int(totaltime/interval)):
268 for i in range(int(waittime/pollinterval)):
269 269 if self.is_alive():
270 time.sleep(interval)
270 time.sleep(pollinterval)
271 271 else:
272 272 break
273 273 else:
@@ -311,7 +311,7 b' class KernelManager(LoggingConfigurable, ConnectionFileMixin):'
311 311 # Don't send any additional kernel kill messages immediately, to give
312 312 # the kernel a chance to properly execute shutdown actions. Wait for at
313 313 # most 1s, checking every 0.1s.
314 self.wait_shutdown()
314 self.finish_shutdown()
315 315
316 316 self.cleanup(connection_file=not restart)
317 317
@@ -138,7 +138,7 b' class MultiKernelManager(LoggingConfigurable):'
138 138 """Ask a kernel to shut down by its kernel uuid"""
139 139
140 140 @kernel_method
141 def wait_shutdown(self, kernel_id, totaltime=1, interval=0.1):
141 def finish_shutdown(self, kernel_id, waittime=1, pollinterval=0.1):
142 142 """Wait for a kernel to finish shutting down, and kill it if it doesn't
143 143 """
144 144 self.log.info("Kernel shutdown: %s" % kernel_id)
@@ -163,7 +163,7 b' class MultiKernelManager(LoggingConfigurable):'
163 163 for kid in kids:
164 164 self.request_shutdown(kid)
165 165 for kid in kids:
166 self.wait_shutdown(kid)
166 self.finish_shutdown(kid)
167 167 self.cleanup(kid)
168 168
169 169 @kernel_method
General Comments 0
You need to be logged in to leave comments. Login now