fail gracefully for pointless merge

Bug #1114984 reported by Martin Mrazik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
jenkins-launchpad-plugin
Confirmed
Medium
Unassigned

Bug Description

This should not be happening:

DEBUG: Merging lp:~timo-jyrinki/ubuntu-ui-toolkit/qdocpaths to lp:ubuntu-ui-toolkit
Traceback (most recent call last):
  File "/var/lib/jenkins/jenkins-launchpad-plugin/autoland.py", line 246, in <module>
    sys.exit(main())
  File "/var/lib/jenkins/jenkins-launchpad-plugin/autoland.py", line 237, in main
    return merge_and_commit(launchpad, mp, args)
  File "/var/lib/jenkins/jenkins-launchpad-plugin/autoland.py", line 101, in merge_and_commit
    target.merge(source, str(mp.reviewed_revid))
  File "/usr/local/lib/python2.7/dist-packages/tarmac/branch.py", line 103, in merge
    branch.bzr_branch, to_revision=revid)
  File "<string>", line 4, in merge_from_branch_write_locked
  File "/usr/lib/python2.7/dist-packages/bzrlib/workingtree.py", line 797, in merge_from_branch
    raise errors.PointlessMerge
bzrlib.errors.PointlessMerge: Nothing to merge.

Related branches

Changed in jenkins-launchpad-plugin:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Martin Mrazik (mrazik) wrote :

From https://code.launchpad.net/~mrazik/jenkins-launchpad-plugin/stale-locks-take2/+merge/166452 :

>> There is one issue, though -- fasttrack merges. I just noticed a pointless
>> merge and as far as I can see it is because the autolanding was triggered
>> while the other generic-land (which I started manually due to some unrelated
>> bug) was still running.
>> OTOH the problem is probably not introduced by this branch and explains why
>> I'm seeing these pointless merges every now and then.
>
> I was wrong about this. It is a newly introduced regression. OTOH solving this
> would most likely add yet another level of complexity and:
> 1. even if it happens nothing really bad happens (just the pointless merge
> error)
> 2. it shouldn't be happening very often as the generic-land is usually
> finished in 15 mins (the time between to triggering operations)

Right. The fasttrack MPs never call the autolanding job, they go straight to generic-land. As this new method looks for the MPs that were started from the autolanding job, it won't find a downstream build due to the upstream check.

I agree that we are safe for now as long as the second generic-land does not change the state of the MP from Merged to something else.

Revision history for this message
Martin Mrazik (mrazik) wrote :

I think there are two options how to fix this:

1. Catch the exception and make the autoland.py command to exit with 1 (i.e. the generic-land job will fail and will indicate a problem).

The issue from https://code.launchpad.net/~mrazik/jenkins-launchpad-plugin/stale-locks-take2/+merge/166452 will be therefore generating a bit of noise (but not too much as this should really happen very rarely).

Merge proposals that are still Approved but should be Merged (i.e. launchpad didn't detect the merge correctly) will stay Approved with no additional information. OTOH the generic-land job will fail (so indicating there is a failure) as well as the "check for stalled MPs" job. This will need a manual interaction and changing the job state to "Merged".

2. Catch the exception and make a comment in the merge proposal. For example:
"Merging reported a Pointless merge. This branch is most likely merged already. Please check if it is indeed the case and change the state to Merged manually."

The issue from stale-locks-take2 branch would then generate a bit of noise directly on the merge proposal (possibly confusing devs).

In the 2nd case (merged branch which was not detected as merged) it will give a bit more hint to the developers and people who are not watching the "check for stalled MPs" job will be able to correct the issue.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.