示例#1
0
            raise

        except WorkerDied, e:
            self.status("worker died (%s) # %s" % (e, command), True)
            raise self.Error(e)

        except CommandTimeout:
            self.status("timeout # %s" % command, True)
            exitcode = None

        else:
            if ssh_command.exitcode == 255 and re.match(
                    r'^ssh: connect to host.*:.*$', ssh_command.output):
                self.status("worker unreachable # %s" % command)
                self.logs.worker.write("%s\n" % ssh_command.output)
                raise self.Error(SSH.Error(ssh_command.output))

            self.status("exit %d # %s" % (ssh_command.exitcode, command), True)
            exitcode = ssh_command.exitcode

        finally:
            ssh_command.terminate()

        if ssh_command.exitcode != 0:
            self.strike += 1
            if self.strikes and self.strike >= self.strikes:
                self.status("terminating worker after %d strikes" %
                            self.strikes)
                raise self.Error

            if job.retry < job.retry_limit: