513
513
d = defer.succeed(None)
515
def resume_done(ignored):
515
def ping_done(ignored):
516
516
return self.current_build_behavior.dispatchBuildToSlave(
517
517
build_queue_item.id, logger)
519
def eb_slave_failure(failure):
520
failure.trap(BuildSlaveFailure)
523
"Exception (%s) when setting up to new job" % (e,))
525
def eb_cannot_fetch_file(failure):
526
failure.trap(CannotFetchFile)
528
message = """Slave '%s' (%s) was unable to fetch file.
534
""" % (self.name, self.url, e.file_url, e.error_information)
535
raise BuildDaemonError(message)
537
def eb_socket_error(failure):
538
failure.trap(socket.error)
540
error_message = "Exception (%s) when setting up new job" % (e,)
541
d = self.handleTimeout(logger, error_message)
542
return d.addBoth(lambda ignored: failure)
519
def resume_done(ignored):
520
# Before we try and contact the resumed slave, we're going
521
# to send it a message. This is to ensure it's accepting
522
# packets from the outside world, because testing has shown
523
# that the first packet will randomly fail for no apparent
524
# reason. This could be a quirk of the Xen guest, we're not
525
# sure. We also don't care about the result from this message,
526
# just that it's sent, hence the "addBoth".
529
d = self.slave.echo("ping")
531
d = defer.succeed(None)
544
535
d.addCallback(resume_done)
545
d.addErrback(eb_slave_failure)
546
d.addErrback(eb_cannot_fetch_file)
547
d.addErrback(eb_socket_error)
550
538
def failBuilder(self, reason):