Фикс controlplane
This commit is contained in:
@@ -65,7 +65,12 @@ class RuntimeManager:
|
||||
if not self._started:
|
||||
return
|
||||
self._state = LifecycleState.STOPPING
|
||||
try:
|
||||
self.workers.stop(timeout=timeout, force=force)
|
||||
except TimeoutError:
|
||||
# Do not leave runtime in STOPPING forever for control-plane callers.
|
||||
self.workers.stop(force=True)
|
||||
finally:
|
||||
if stop_control_plane:
|
||||
self.control_plane.stop()
|
||||
self._started = False
|
||||
@@ -85,13 +90,15 @@ class RuntimeManager:
|
||||
async def start_runtime(self) -> str:
|
||||
if self._started:
|
||||
return "runtime already running"
|
||||
if self.workers.lifecycle_state() == LifecycleState.STOPPING:
|
||||
return "runtime is stopping"
|
||||
self.start(start_control_plane=False)
|
||||
return "runtime started"
|
||||
|
||||
async def stop_runtime(self) -> str:
|
||||
if not self._started:
|
||||
return "runtime already stopped"
|
||||
self.stop(stop_control_plane=False)
|
||||
self.stop(timeout=0.0, stop_control_plane=False)
|
||||
return "runtime stopped"
|
||||
|
||||
async def runtime_status(self) -> str:
|
||||
|
||||
Reference in New Issue
Block a user