[devel at bb.net] Problem with GerritChangeSource & Gerrit remote refs

Kevin Funk kevin.funk at kdab.com
Wed Jul 13 16:48:55 UTC 2016


Heya,

We're using Buildbot v0.8.12-ish at our company.

In this particular case I'm talking about a project which has three builders 
assigned to three different slaves. Builds are triggered as soon as a review 
is created/updated on Gerrit (using GerritChangeSource).

# Problem

Sometimes when builds have been queued for a long time (because Buildbot is 
busy), I'm getting this as output on some of the builds:

  git version 2.5.4 (Apple Git-61)
  fatal: Couldn't find remote ref master/35230

Problem: master/35230 is totally wrong, Buildbot should look for something 
like refs/changes/30/35230/1 instead.

Thing is: it works fine for builds that are processed promptly, it breaks for 
builds which have been queued for a longer time (usually > 1 hour). So 
Buildbot *does* fetch refs/changes/30/35230/1 for the former, doesn't do for 
the builds queued "for too long"...

# Interesting log output:

1) Change gets added:

twistd.log.7:2016-07-13 15:24:24+0200 [-] added change 
Change(revision=u'613f6b0c71871607d7b267deb64ea89aaf715aa3', who=u'foo', 
branch=u'master/35230', comments=u'bar', when=1468416264, category=u'patchset-
created', project=u'bla', repository=u'ssh://build@example.com:29418/bla', 
codebase=u'') to database

[Looks good]

2) Builds get started 

$ grep 35230 twistd.log* | grep "command.*fetch"
twistd.log.2:2016-07-13 17:34:53+0200 [-] command '['git', 'fetch', '-t', 
'ssh://example.com:29418/bla', u'master/35230', '--progress']' in dir 'source'
twistd.log.2:2016-07-13 17:34:54+0200 [-] Source step failed while running 
command <RemoteShellCommand '['git', 'fetch', '-t', 'ssh://example.com:29418/
bla', u'master/35230', '--progress']'>
twistd.log.4:2016-07-13 16:26:40+0200 [-] command '['git', 'fetch', '-t', 
'ssh://example.com:29418/bla', u'refs/changes/30/35230/1', '--progress']' in 
dir 'source'
twistd.log.7:2016-07-13 15:27:53+0200 [-] command '['git', 'fetch', '-t', 
'ssh://example.com:29418/bla', u'refs/changes/30/35230/1', '--progress']' in 
dir 'source'

[Looks bad]

^ In this log you can see that two builds successfully fetch the 'refs/... 
ref', but one build (which was delayed significantly) fetches 'master/
35230'(??) instead.

I see that the following file is responsible for deciding which branch to 
fetch:
  master/buildbot/steps/source/gerrit.py

# Questions

Educated guess: It looks like Buildbot "forgets" about the 
'event.patchSet.ref' build property somewhere in-between?!

Can someone enlighten me what's going on? Hints/Suggestions?

Regards,
Kevin

-- 
Kevin Funk | kevin.funk at kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 7021 bytes
Desc: not available
URL: <http://lists.buildbot.net/pipermail/devel/attachments/20160713/be50a759/attachment.bin>


More information about the devel mailing list