code: public static void killProcess(String pid) {
          synchronized (lock) {
              LOG.info("Begin to kill process " + pid);
  
              WorkerShutdown shutdownHandle = getProcessHandle(pid);
  
              if (shutdownHandle != null) {
                  shutdownHandle.shutdown();
              }
  
              processMap.remove(pid);
  
              LOG.info("Successfully killed process " + pid);
          }
      }
docs: Kill a process
  
  @param pid process id