code: def stop_log_server(thread, ip, port):
      if thread.is_alive():
          import inspect
          import ctypes
          import zmq
  
          def _async_raise(tid, exctype):
              tid = ctypes.c_long(tid)
              if not inspect.isclass(exctype):
                  exctype = type(exctype)
              res = ctypes.pythonapi.PyThreadState_SetAsyncExc(
                  tid, ctypes.py_object(exctype)
              )
              if res == 0:
                  invalidInputError(False, "invalid thread id")
              elif res != 1:
                  ctypes.pythonapi.PyThreadState_SetAsyncExc(tid, None)
                  invalidOperationError(
                      False, "PyThreadState_SetAsyncExc failed"
                  )
  
          def stop_thread(thread):
              _async_raise(thread.ident, SystemExit)
  
          with zmq.Context() as context:
              with context.socket(zmq.REQ) as socket:
                  socket.connect("tcp://{}:{}".format(ip, port))
                  socket.send_string("shutdown log server")
          stop_thread(thread)
  
file_path: BigDL/python/orca/src/bigdl/orca/learn/log_monitor.py
imports: import logging
  import os
  import time
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 2 for calling a global function with example usage: stop_log_server(thread, ip, port) without return types