From 88a85092eb499588c5da2050e2e7e659f7b6055c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Thu, 26 Sep 2024 13:17:48 -0700 Subject: [PATCH] Disable overwatcher checks in emergency_close and shutdown --- src/gort/gort.py | 21 ++++++++++----------- src/gort/tools.py | 1 + 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gort/gort.py b/src/gort/gort.py index 77020b3..79b7b12 100644 --- a/src/gort/gort.py +++ b/src/gort/gort.py @@ -51,7 +51,6 @@ get_temporary_file_path, kubernetes_list_deployments, kubernetes_restart_deployment, - overwatcher_is_running, run_in_executor, ) @@ -665,11 +664,11 @@ async def notify_event(self, event: Event, payload: dict[str, Any] = {}): async def emergency_close(self): """Parks and closes the telescopes.""" - if await overwatcher_is_running(self): - self.log.warning( - "Overwatcher is running but overriding. However " - "be aware that the Overwatcher could reopen the enclosure." - ) + # if await overwatcher_is_running(self): + # self.log.warning( + # "Overwatcher is running but overriding. However " + # "be aware that the Overwatcher could reopen the enclosure." + # ) tasks = [] tasks.append(self.telescopes.park(disable=True)) @@ -986,11 +985,11 @@ async def startup(self, **kwargs): async def shutdown(self, **kwargs): """Executes the :obj:`shutdown <.ShutdownRecipe>` sequence.""" - if await overwatcher_is_running(self): - raise GortError( - "Overwatcher is running. Cannot shutdown. If you really need " - "to shutdown, execute Gort.emergency_close()." - ) + # if await overwatcher_is_running(self): + # raise GortError( + # "Overwatcher is running. Cannot shutdown. If you really need " + # "to shutdown, execute Gort.emergency_close()." + # ) return await self.execute_recipe("shutdown", **kwargs) diff --git a/src/gort/tools.py b/src/gort/tools.py index 145a66c..95908d8 100644 --- a/src/gort/tools.py +++ b/src/gort/tools.py @@ -1045,6 +1045,7 @@ async def is_actor_running(actor: str, client: AMQPClient | None = None): if not client: client = await AMQPClient().start() + # TODO: this can fail if the event loop has closed the client connection. ping = await client.send_command(actor, "ping") if ping.status.did_succeed: return True