Terminate, wait for exit, join reader threads, and log output.
(self)
| 50 | self.process.terminate() |
| 51 | |
| 52 | def cleanup(self): |
| 53 | """Terminate, wait for exit, join reader threads, and log output.""" |
| 54 | self.terminate() |
| 55 | try: |
| 56 | self.process.wait(timeout=GRACEFUL_SHUTDOWN_TIMEOUT) |
| 57 | except subprocess.TimeoutExpired: |
| 58 | self.process.kill() |
| 59 | self.process.wait() |
| 60 | for t in self._threads: |
| 61 | t.join(timeout=READER_THREAD_JOIN_TIMEOUT) |
| 62 | if self._capture_output: |
| 63 | stdout = b"".join(self._stdout_lines).decode("utf-8", errors="replace") |
| 64 | if stdout: |
| 65 | LOGGER.info(f"cloudflared stdout:\n{stdout}") |
| 66 | |
| 67 | @property |
| 68 | def stdout_lines(self): |
no test coverage detected