~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/buildmaster/model/builder.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-08-23 14:59:07 UTC
  • mfrom: (11403.3.3 lost-builder-bug-463046)
  • Revision ID: launchpad@pqm.canonical.com-20100823145907-l7ufseroz6qtaqdt
[r=henninge][ui=none][bug=463046] Reset aborted builders that don't
        have any buildqueue entry so they don't sit idle forever.

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
    # IBuilder.slaveStatusSentence().
207
207
    status = status_sentence[0]
208
208
 
 
209
    # If the cookie test below fails, it will request an abort of the
 
210
    # builder.  This will leave the builder in the aborted state and
 
211
    # with no assigned job, and we should now "clean" the slave which
 
212
    # will reset its state back to IDLE, ready to accept new builds.
 
213
    # This situation is usually caused by a temporary loss of
 
214
    # communications with the slave and the build manager had to reset
 
215
    # the job.
 
216
    if status == 'BuilderStatus.ABORTED' and builder.currentjob is None:
 
217
        builder.cleanSlave()
 
218
        if logger is not None:
 
219
            logger.info(
 
220
                "Builder '%s' cleaned up from ABORTED" % builder.name)
 
221
        return
 
222
 
209
223
    # If slave is not building nor waiting, it's not in need of rescuing.
210
224
    if status not in ident_position.keys():
211
225
        return
220
234
        else:
221
235
            builder.requestAbort()
222
236
        if logger:
223
 
            logger.warn(
 
237
            logger.info(
224
238
                "Builder '%s' rescued from '%s': '%s'" %
225
239
                (builder.name, slave_build_id, reason))
226
240