← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jelmer/launchpad/later-upload-move into lp:launchpad/devel

 

Jelmer Vernooij has proposed merging lp:~jelmer/launchpad/later-upload-move into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


We've had two bugs with builds that failed to upload. They would be moved out of the queue but before their build status was updated (to FULLYBUILT or FAILEDTOUPLOAD). 

This changes the move to be right after the database commit. This means the window for inconsistency is very small.  
-- 
https://code.launchpad.net/~jelmer/launchpad/later-upload-move/+merge/41749
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jelmer/launchpad/later-upload-move into lp:launchpad/devel.
=== modified file 'lib/lp/archiveuploader/uploadprocessor.py'
--- lib/lp/archiveuploader/uploadprocessor.py	2010-11-22 16:35:22 +0000
+++ lib/lp/archiveuploader/uploadprocessor.py	2010-11-24 15:36:18 +0000
@@ -250,7 +250,6 @@
             UploadStatusEnum.FAILED: "failed",
             UploadStatusEnum.REJECTED: "rejected",
             UploadStatusEnum.ACCEPTED: "accepted"}[result]
-        self.moveProcessedUpload(upload_path, destination, logger)
         build.date_finished = datetime.datetime.now(pytz.UTC)
         if not (result == UploadStatusEnum.ACCEPTED and
                 build.verifySuccessfulUpload() and
@@ -258,7 +257,8 @@
             build.status = BuildStatus.FAILEDTOUPLOAD
             build.notify(extra_info="Uploading build %s failed." % upload)
             build.storeUploadLog(logger.buffer.getvalue())
-            self.ztm.commit()
+        self.ztm.commit()
+        self.moveProcessedUpload(upload_path, destination, logger)
 
     def processUpload(self, fsroot, upload):
         """Process an upload's changes files, and move it to a new directory.