code: def exit_on_fd_close(fd):
      while True:
          rl, _, _ = select.select([fd], [], [], 0)
          if fd in rl:
              logger.warning(
                  "Communication with master is closed, exiting"
              )
              # sock is closed"
              exit_by_signal()
          time.sleep(1)
  
file_path: fiber/fiber/spawn.py
imports: import os
  import logging
  from multiprocessing import reduction
  import multiprocessing
  import threading
  import traceback
  import select
  import signal
  import time
  from fiber.init import init_fiber
label_desc: Use image node_id 2 for calling a global function with example usage: exit_on_fd_close(fd) without return types