"""
        Terminate (and then kill) the process launched to process the file.
        :param sigkill: whether to issue a SIGKILL if SIGTERM doesn't work.
        """
        if self._process is None or self._parent_channel is None:
            raise AirflowException("Tried to call terminate before starting!")
        self._process.terminate()
        
        with suppress(TimeoutError):
            self._process._popen.wait(5)  
        if sigkill:
            self._kill_process()
        self._parent_channel.close()
    def _kill_process(self) -> None:
        if self._process is None:
            raise AirflowException("Tried to kill process before starting!")
        if self._process.is_alive() and self._process.pid:
            self.log.warning("Killing DAGFileProcessorProcess (PID=%d)", self._process.pid)
            os.kill(self._process.pid, signal.SIGKILL)
            
            
            
            while self._process._popen.poll() is None:  
                time.sleep(0.001)
        if self._parent_channel:
            self._parent_channel.close()
    @property
    def pid(self) -> int: