def METHOD_NAME(self):
    # if the process has already exited on its own, just return
    if self.detect_process and self.detect_process.exitcode:
        return
    self.detect_process.terminate()
    logging.info("Waiting for detection process to exit gracefully...")
    self.detect_process.join(timeout=30)
    if self.detect_process.exitcode is None:
        logging.info("Detection process didnt exit. Force killing...")
        self.detect_process.kill()
        self.detect_process.join()
    logging.info("Detection process has exited...")