class_docstr: Instance of ``SubmittedRun`` corresponding to a subprocess launched to run an entry point
  command locally.
class_docstr_tok: ["Instance","of","``","SubmittedRun","``","corresponding","to","a","subprocess","launched","to","run","an","entry","point","command","locally","."]
code: def cancel(self):
      # Interrupt child process if it hasn't already exited
      if self.command_proc.poll() is None:
          # Kill the the process tree rooted at the child if it's the leader of its own process
          # group, otherwise just kill the child
          try:
              if self.command_proc.pid == os.getpgid(
                  self.command_proc.pid
              ):
                  os.killpg(self.command_proc.pid, signal.SIGTERM)
              else:
                  self.command_proc.terminate()
          except OSError:
              # The child process may have exited before we attempted to terminate it, so we
              # ignore OSErrors raised during child process termination
              _logger.info(
                  "Failed to terminate child process (PID %s) corresponding to MLflow "
                  "run with ID %s. The process may have already exited.",
                  self.command_proc.pid,
                  self._run_id,
              )
          self.command_proc.wait()
  
file_path: mlflow/mlflow/projects/submitted_run.py
imports: import logging
  import os
  import signal
  from abc import abstractmethod
  from mlflow.entities import RunStatus
  from mlflow.utils.annotations import developer_stable
label_desc: Use image node_id 4 for calling the LocalSubmittedRun obj's underlying member method code with example usage: obj.cancel() without return types