Error generating merge proposal diff when "source branch has pending writes"

Bug #612171 reported by James Westby
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Martin Pool

Bug Description

I just received this email:

Subject: Launchpad error while generating the diff for a merge proposal
From: <email address hidden>
To: James Westby <email address hidden>
Date: Sat, 31 Jul 2010 23:28:44 -0000

Launchpad encountered an error during the following operation: generating the diff for a merge proposal. The source branch has pending writes.

I don't really know what it means, which merge proposal it is referring to, or what
I can do about it, so I don't know why I got an email about it.

As for the cause, it's probably as I pushed twice to the same branch in relatively
quick succession.

Thanks,

James

Related branches

Revision history for this message
Aaron Bentley (abentley) wrote :

It would help to know what the merge proposal was. This could be a dupe of bug #610713

tags: added: code-review
Revision history for this message
James Westby (james-w) wrote : Re: [Bug 612171] Re: Error generating merge proposal diff when "source branch has pending writes"

BranchMergeProposalJobSource.iterReady() calls checkReady(), and catches
exceptions that the job isn't ready and waits.

UpdatePreviewDiffJob.run() calls checkReady() but lets the exception
bubble up, which ends up sending an email.

If the state of the branch changes between the two events then this
behaviour will happen.

I think run() needs a way to signal that the job should be deferred for some
time to handle this.

There are other issues too, such as the email not having much
information.

The cases that the user would be mailed about would be:

        if bmp.source_branch.last_scanned_id is None:
            raise UpdatePreviewDiffNotReady(
                'The source branch has no revisions.')
        if bmp.target_branch.last_scanned_id is None:
            raise UpdatePreviewDiffNotReady(
                'The target branch has no revisions.')
        if bmp.source_branch.pending_writes:
            raise UpdatePreviewDiffNotReady(
                'The source branch has pending writes.')

where I'm not sure any of them are useful.

The first two should give an empty diff on the merge proposal or
something. The latter should just delay, and then oops if it has been
delayed multiple times, as there is something wrong.

Thanks,

James

Aaron Bentley (abentley)
Changed in launchpad-code:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
James Westby (james-w) wrote :

I just got this again on

  https://code.edge.launchpad.net/~james-w/launchpad/soyuz-factory-improvements/+merge/31890

you can see that I pushed two revisions in quick succession.

Thanks,

James

Revision history for this message
Guilherme Salgado (salgado) wrote :

I got this as well, but in my case there was only one revision recently pushed, and it was pushed long before the merge proposal was created. https://code.edge.launchpad.net/~salgado/launchpad/layer-specific-navigation/+merge/32119

Revision history for this message
Guilherme Salgado (salgado) wrote :

And I got another email like that after resubmitting my proposal. (the submitted one: https://code.edge.launchpad.net/~salgado/launchpad/layer-specific-navigation/+merge/32124)

Revision history for this message
Guilherme Salgado (salgado) wrote :

In my case it seems to be a different problem -- Aaron told me it wasn't generating the diff because of a bug (which is fixed in devel) that is triggered when you use a merge directive. I've deleted that branch, created a new one and then the new mp got a diff.

Revision history for this message
Robert Collins (lifeless) wrote :

I've just hit this.

Revision history for this message
Robert Collins (lifeless) wrote :

I think we should raise this to high - its a very opaque error that will leave a poor impression on users.

Revision history for this message
Vincent Ladeuil (vila) wrote :

@lifeless: I respect de-duplicating this bug from Bug #640882 and bug #702411 but fixing one should be easier for someone already fixing the other no ? Or may give some hint...

Revision history for this message
Robert Collins (lifeless) wrote :

There are two separate bugs: fixing the error could be done without improving the error message. And somone fixing the error message can do so without looking into the cause of the error at all.

Changed in launchpad:
importance: Medium → High
Revision history for this message
Martin Pool (mbp) wrote :

bug 640882 is probably a dupe of this.

I think there is no point sending this to users and we might as well just suppress the mail and log it internally. Separately, we can deal with any merge proposals that are getting permanently stuck - there may already be separate bugs for them. When I've seen this message, the actual mp has generally looked fine _or_ there has been another more obvious bug.

Martin Pool (mbp)
Changed in launchpad:
status: Triaged → In Progress
assignee: nobody → Martin Pool (mbp)
Martin Pool (mbp)
tags: added: qa-untestable
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
removed: qa-untestable
Changed in launchpad:
status: In Progress → Fix Committed
Revision history for this message
Martin Pool (mbp) wrote :

untestable: the race is a bit hard to hit and qas's code hosting and mail setup is unrealistic

tags: added: qa-untestable
removed: qa-needstesting
Changed in launchpad:
status: Fix Committed → Fix Released
Revision history for this message
Loïc Minier (lool) wrote :

(Looks like I'm getting another occurrence of this in bug #1231589.)

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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