From d96a9fa19225b95b51d9d4422ad82324e75ad6d0 Mon Sep 17 00:00:00 2001 From: Amog Kamsetty Date: Mon, 25 Jan 2021 10:35:25 -0800 Subject: [PATCH] Revert "Revert "[dashboard] Fix RAY_RAYLET_PID KeyError on Windows (#12948)" (#13572)" (#13685) This reverts commit c4a710369b93964e219af83bb197542241750627. --- dashboard/agent.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dashboard/agent.py b/dashboard/agent.py index f1c496b89..7bf5e1551 100644 --- a/dashboard/agent.py +++ b/dashboard/agent.py @@ -62,9 +62,13 @@ class DashboardAgent(object): self.object_store_name = object_store_name self.raylet_name = raylet_name self.node_id = os.environ["RAY_NODE_ID"] - self.ppid = int(os.environ["RAY_RAYLET_PID"]) - assert self.ppid > 0 - logger.info("Parent pid is %s", self.ppid) + # TODO(edoakes): RAY_RAYLET_PID isn't properly set on Windows. This is + # only used for fate-sharing with the raylet and we need a different + # fate-sharing mechanism for Windows anyways. + if sys.platform not in ["win32", "cygwin"]: + self.ppid = int(os.environ["RAY_RAYLET_PID"]) + assert self.ppid > 0 + logger.info("Parent pid is %s", self.ppid) self.server = aiogrpc.server(options=(("grpc.so_reuseport", 0), )) self.grpc_port = self.server.add_insecure_port( f"[::]:{self.dashboard_agent_port}") @@ -108,7 +112,8 @@ class DashboardAgent(object): logger.error("Failed to check parent PID, exiting.") sys.exit(1) - check_parent_task = create_task(_check_parent()) + if sys.platform not in ["win32", "cygwin"]: + check_parent_task = create_task(_check_parent()) # Create an aioredis client for all modules. try: