Bug #23434
openRGWs report canceled PUT requests as 500s instead of 408s
0%
Description
While troubleshooting some issues that were being recorded in the civetweb access logs on 10.2.10, I noticed that S3 PUT requests that are canceled (for example when you hit ctrl-c during the upload) are showing up in the logs as 500s (internal server error). I compared this to how nginx handles partial uploads and it uses either a 408 (request timeout) or as a 400 (bad request). I think these are more descriptive of the actual problem and would like to see radosgw use them as well.
Updated by Matt Benjamin about 6 years ago
The rationale for returning 500 in a variety of cases, is to ensure they are retried by S3 clients. That might apply in a case where RGW is certain that the client abandoned the request, but returning 4XX to a client could have semantic effects.
https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html
"""
Retry InternalErrors
Internal errors are errors that occur within the Amazon S3 environment.
Requests that receive an InternalError response might not have processed. For example, if a PUT request returns InternalError, a subsequent GET might retrieve the old value or the updated value.
If Amazon S3 returns an InternalError response, retry the request.
"""