code: def test_redis_data_loss_no_leak(
      ray_start_regular_with_external_redis,
  ):
      @ray.remote
      def create_actor():
          @ray.remote
          class A:
              def pid(self):
                  return os.getpid()
  
          a = A.options(lifetime="detached", name="A").remote()
          ray.get(a.pid.remote())
  
      ray.get(create_actor.remote())
  
      ray._private.worker._global_node.kill_gcs_server()
      # Delete redis
      redis_addr = os.environ.get("RAY_REDIS_ADDRESS")
      import redis
  
      ip, port = redis_addr.split(":")
      cli = redis.Redis(ip, port)
      cli.flushall()
      raylet_proc = ray._private.worker._global_node.all_processes[
          ray_constants.PROCESS_TYPE_RAYLET
      ][0].process
  
      def check_raylet_healthy():
          return raylet_proc.poll() is None
  
      wait_for_condition(lambda: check_raylet_healthy())
  
      # Start GCS
      ray._private.worker._global_node.start_gcs_server()
  
      # Waiting for raylet to become unhealthy
      wait_for_condition(lambda: not check_raylet_healthy())
  
imports: import sys
  import os
  import threading
  from time import sleep
  import pytest
  import ray
  from ray._private.utils import get_or_create_event_loop
  from ray.util.scheduling_strategies import PlacementGroupSchedulingStrategy
  import ray._private.gcs_utils
  from ray._private import ray_constants
  from ray._private.test_utils import convert_actor_state, enable_external_redis, generate_system_config_map, wait_for_condition, wait_for_pid_to_exit, run_string_as_driver
  from ray.job_submission import JobSubmissionClient, JobStatus
  from ray._raylet import GcsClient
  import psutil
label_desc: Use image node_id 22 for calling a global function with example usage: test_redis_data_loss_no_leak(ray_start_regular_with_external_redis) and returns: unknown, os