Merge pull request #1020 from coreos-inc/nginx-read-timeout

Increase nginx proxy timeout and close db before storage operation
This commit is contained in:
Silas Sewell 2015-12-03 11:49:58 -05:00
commit ea87905527
2 changed files with 13 additions and 10 deletions

View file

@ -64,6 +64,8 @@ location ~ ^/v2 {
proxy_request_buffering off;
proxy_read_timeout 300;
proxy_http_version 1.1;
proxy_pass http://registry_app_server;

View file

@ -215,9 +215,10 @@ def _finish_upload(namespace, repo_name, upload_obj, expected_digest):
if not digest_tools.digests_equal(computed_digest, expected_digest):
raise BlobUploadInvalid()
# Move the storage into place, or if this was a re-upload, cancel it
final_blob_location = digest_tools.content_path(expected_digest)
# Move the storage into place, or if this was a re-upload, cancel it
with database.CloseForLongOperation(app.config):
if storage.exists({upload_obj.location.name}, final_blob_location):
# It already existed, clean up our upload which served as proof that we had the file
storage.cancel_chunked_upload({upload_obj.location.name}, upload_obj.uuid,