code: def execute_task_with_fault_tolerance(self):
      i = 0
      while True:
          i = i + 1
          try:
              ray.get(
                  self.worker.execute_task.remote(crash=(i % 2 == 1))
              )
              # Checkpoint the latest worker state
              self.worker_state = ray.get(
                  self.worker.checkpoint.remote()
              )
              return
          except ray.exceptions.RayActorError:
              print("Actor crashes, restarting...")
              # Restart the actor and restore the state
              self.worker = Worker.remote()
              ray.get(self.worker.restore.remote(self.worker_state))
  
file_path: ray/doc/source/ray-core/doc_code/actor_checkpointing.py
imports: import os
  import sys
  import ray
  import json
  import tempfile
  import shutil
label_desc: Use image node_id 2 for calling the Controller obj's underlying member method code with example usage: obj.execute_task_with_fault_tolerance() without return types