]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix chunk upload fallback behavior
authorepriestley <git@epriestley.com>
Thu, 19 Mar 2015 02:06:27 +0000 (19:06 -0700)
committerepriestley <git@epriestley.com>
Thu, 19 Mar 2015 02:06:27 +0000 (19:06 -0700)
Summary:
Ref T7594. Currently, if a chunk upload fails, we incorrectly swallow the failure and fall back to single-file upload, which will often fail by hitting size limits. This also silences the original error.

Instead, do chunk uploads outside the block so that any exceptions escape, and we don't try to fall back to single-file upload.

Mostly just trying to get more info about what's going wrong on @joshuaspence's install.

Test Plan: Faked an exception in chunk upload, ran `arc upload` on a big file, saw the exception displayed on the console.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley, joshuaspence

Maniphest Tasks: T7594

Differential Revision: https://secure.phabricator.com/D12111

src/workflow/ArcanistUploadWorkflow.php

index 12548e2b8c4f4d33843bc6b4c291c9cb3698f7dc..7094cdce69297c8374f734ea308303a1065fbd4c 100644 (file)
@@ -66,6 +66,8 @@ EOTEXT
       }
       $length = filesize($path);
 
+      $do_chunk_upload = false;
+
       $phid = null;
       try {
         $result = $conduit->callMethodSynchronous(
@@ -90,7 +92,7 @@ EOTEXT
           // file data.
         } else {
           if ($phid) {
-            $this->uploadChunks($phid, $path);
+            $do_chunk_upload = true;
           } else {
             // This is a small file that doesn't need to be uploaded in
             // chunks, so continue normally.
@@ -101,6 +103,10 @@ EOTEXT
           pht('Unable to use allocate method, trying older upload method.'));
       }
 
+      if ($do_chunk_upload) {
+        $this->uploadChunks($phid, $path);
+      }
+
       if (!$phid) {
         try {
           $data = Filesystem::readFile($path);