(self)
| 312 | print(f"Failed to establish connection with worker: {last_exception}") |
| 313 | |
| 314 | def close(self) -> None: |
| 315 | if self.connected: |
| 316 | self.conn.close() |
| 317 | # Technically we don't need to wait, but otherwise we will get ResourceWarnings. |
| 318 | try: |
| 319 | self.proc.wait(timeout=WORKER_SHUTDOWN_TIMEOUT) |
| 320 | except subprocess.TimeoutExpired: |
| 321 | pass |
| 322 | if os.path.isfile(self.status_file): |
| 323 | os.unlink(self.status_file) |
| 324 | |
| 325 | |
| 326 | def build_error(msg: str) -> NoReturn: |