Kill workers that have timed out.
(self)
| 1045 | pass |
| 1046 | |
| 1047 | async def murder_workers(self): |
| 1048 | """Kill workers that have timed out.""" |
| 1049 | if not self.cfg.dirty_timeout: |
| 1050 | return |
| 1051 | |
| 1052 | for pid, worker in list(self.workers.items()): |
| 1053 | try: |
| 1054 | if time.monotonic() - worker.tmp.last_update() <= self.cfg.dirty_timeout: |
| 1055 | continue |
| 1056 | except (OSError, ValueError): |
| 1057 | continue |
| 1058 | |
| 1059 | if not worker.aborted: |
| 1060 | self.log.critical("DIRTY WORKER TIMEOUT (pid:%s)", pid) |
| 1061 | worker.aborted = True |
| 1062 | self.kill_worker(pid, signal.SIGABRT) |
| 1063 | else: |
| 1064 | self.kill_worker(pid, signal.SIGKILL) |
| 1065 | |
| 1066 | def reap_workers(self): |
| 1067 | """Reap dead worker processes.""" |