[Buildbot-devel] buildbot: correct monotone source step

Markus Wanner markus at bluegap.ch
Fri Apr 17 13:02:55 UTC 2015


Hi,

on buildbot.monotone.ca, a buildbot master instance is running. As
recently brought up on IRC, I had issues with it since I switched to use
the newer server-side source step.

The attached patch fixes two issues in steps/source/mtn.py:

 a) in _sourcedirIsUpdatable, the inline function cont served as a
    callback to the deferred returned by _sourcedirIsUpdatable. However,
    it uses d.addCallback, where d is what's calling it. I.e. at the
    time of execution, d is already called. It seems strange to add
    another callback. Further, and probably the actual bug: It doesn't
    return a value. I think that's what led to the hang I originally
    discovered.

    I fixed it rewriting _sourcedirIsUpdatable as an inlined
    callback method, which first checks for the existence of both, the
    _MTN directory and the database db.mtn, and only decides *after*
    both checks. I added proper logging to simplify debugging in the
    future.

 b) startVC calls _checkDb, which in turn runs 'mtn db info' on the
    database db.mtn. However, if the database doesn't exist, yet, that
    command fails, writing an error message to stderr (not stdout).
    This aborts the entire step, rather than creating and filling the
    database.

    The fix in the patch is not optimal: I simply set abandonOnFailure
    to False. A better solution would be to check for the existence of
    the database db.mtn first (that's done in _sourcedirIsUpdatable,
    anyways) and only run 'mtn db info' if it is known to exist. (Or
    skip the existence test and properly parse stderr. However, that
    seems prone to error, IMO.)

The patch as attached applies to buildbot release 0.8.10. I'm happy to
test an improved variant of it, if necessary.

Regards

Markus Wanner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: buildbot_mtn_fix.diff
Type: text/x-patch
Size: 1985 bytes
Desc: not available
URL: <http://buildbot.net/pipermail/devel/attachments/20150417/e57b75c2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1513 bytes
Desc: OpenPGP digital signature
URL: <http://buildbot.net/pipermail/devel/attachments/20150417/e57b75c2/attachment-0001.bin>


More information about the devel mailing list