code: def test_gcs_server_restart(ray_start_regular_with_external_redis):
      actor1 = Increase.remote()
      result = ray.get(actor1.method.remote(1))
      assert result == 3
  
      ray._private.worker._global_node.kill_gcs_server()
      ray._private.worker._global_node.start_gcs_server()
  
      actor2 = Increase.remote()
      result = ray.get(actor2.method.remote(2))
      assert result == 4
  
      result = ray.get(increase.remote(1))
      assert result == 2
  
      # Check whether actor1 is alive or not.
      # NOTE: We can't execute it immediately after gcs restarts
      # because it takes time for the worker to exit.
      result = ray.get(actor1.method.remote(7))
      assert result == 9
  
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 2 for calling a global function with example usage: test_gcs_server_restart(ray_start_regular_with_external_redis) without return types