mononoke: lfs: Return filestore upload result from internal_upload

Summary:
When uploading content to the LFS server it attempts to store the
content in an upstream server, as well as internal data stores. If either of
those fail, then the upload should be considered a failure and the client
should retry. However, D22192005 (ce7f53422f) refactored the code and accidentally updated
`internal_upload` to always return `Ok(())`.

This meant that a failure to write to the filestore wasn't propagated and so an
upload that actually failed would send an HTTP 200 to the client.
Unfortunately, when the client asks for the blob later the server doesn't know
about it.

Update the code to return `res`, so that errors are propagated.

Reviewed By: krallin

Differential Revision: D35892336

fbshipit-source-id: 5302a34fdd338975e0f0db369ed66692db0ade9f
This commit is contained in:
Harvey Hunt 2022-04-25 05:34:31 -07:00 committed by Facebook GitHub Bot
parent 06973c2937
commit 9b18b0d3be

View File

@ -169,7 +169,7 @@ where
STATS::internal_success.add_value(1);
}
Ok(())
res.map(|_| ())
}
async fn upstream_upload<S>(