# being killed by a signal.
self.cancel()
+ def _zombie(self):
+ phase = self._get_phase()
+
+ msg = _("The ebuild phase '%s' appears "
+ "to have left a zombie process with "
+ "pid %d.") % (phase, self.pid)
+
+ for l in textwrap.wrap(msg, 72):
+ eerror(l, phase=phase, key=self.settings.mycpv)
+
def _pipe(self, fd_pipes):
stdout_pipe = fd_pipes.get(1)
got_pty, master_fd, slave_fd = \
return self.returncode
if self._registered:
- self.scheduler.schedule(self._reg_id)
+ if self.cancelled:
+ timeout = 1000
+ self.scheduler.schedule(self._reg_id, timeout=timeout)
+ if self._registered:
+ try:
+ os.kill(self.pid, signal.SIGKILL)
+ except OSError as e:
+ if e.errno != errno.ESRCH:
+ raise
+ del e
+ self.scheduler.schedule(self._reg_id, timeout=timeout)
+ if self._registered:
+ self._zombie()
+ else:
+ self.scheduler.schedule(self._reg_id)
self._unregister()
if self.returncode is not None:
return self.returncode
return self.returncode
+ def _zombie(self):
+ pass
+
def _unregister(self):
"""
Unregister from the scheduler and close open files.