diff options
author | Clay Gerrard <clay.gerrard@gmail.com> | 2021-07-05 14:40:17 -0500 |
---|---|---|
committer | Clay Gerrard <clay.gerrard@gmail.com> | 2021-07-05 14:52:04 -0500 |
commit | 391cc713e9982ad2dbea81aeacfd7b2dd6e852db (patch) | |
tree | fb4ec9ca9e62b3d72fbf5ccf635cab14d14c5ed6 /swift/common/middleware/s3api/s3request.py | |
parent | 2117a32b992deef1d7487f1e997abb028a9f56d6 (diff) | |
download | swift-391cc713e9982ad2dbea81aeacfd7b2dd6e852db.tar.gz |
Handle ClientDisconnect on s3api object PUT
Mostly when I disconnect during upload with s3api clients I see the
proxy log a traceback for EPIPE, but if I set my my client_timeout low
and the proxy initiates the disconnect s3api will get surprised by the
499 response and return 500.
Now s3api will handle it the same as a RequestTimeout, which looks like
a 400 on the wire if anyone is still there.
Change-Id: I08be94fc5cf16679f41a2fd08ce1d52ce6300871
Diffstat (limited to 'swift/common/middleware/s3api/s3request.py')
-rw-r--r-- | swift/common/middleware/s3api/s3request.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/swift/common/middleware/s3api/s3request.py b/swift/common/middleware/s3api/s3request.py index 37ab4e8e6..ed453fb55 100644 --- a/swift/common/middleware/s3api/s3request.py +++ b/swift/common/middleware/s3api/s3request.py @@ -34,7 +34,8 @@ from swift.common.http import HTTP_OK, HTTP_CREATED, HTTP_ACCEPTED, \ HTTP_PARTIAL_CONTENT, HTTP_NOT_MODIFIED, HTTP_PRECONDITION_FAILED, \ HTTP_REQUESTED_RANGE_NOT_SATISFIABLE, HTTP_LENGTH_REQUIRED, \ HTTP_BAD_REQUEST, HTTP_REQUEST_TIMEOUT, HTTP_SERVICE_UNAVAILABLE, \ - HTTP_TOO_MANY_REQUESTS, HTTP_RATE_LIMITED, is_success + HTTP_TOO_MANY_REQUESTS, HTTP_RATE_LIMITED, is_success, \ + HTTP_CLIENT_CLOSED_REQUEST from swift.common.constraints import check_utf8 from swift.proxy.controllers.base import get_container_info @@ -1310,6 +1311,7 @@ class S3Request(swob.Request): HTTP_LENGTH_REQUIRED: MissingContentLength, HTTP_REQUEST_TIMEOUT: RequestTimeout, HTTP_PRECONDITION_FAILED: PreconditionFailed, + HTTP_CLIENT_CLOSED_REQUEST: RequestTimeout, }, 'POST': { HTTP_NOT_FOUND: not_found_handler, |