When creating a object larger than 5GB with the content-length header set, the server does not error until after the first 5GB of data has been sent
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
-------
Description
-------
When creating a object larger than 5GB with the content-length header set, the server does not error until after the first 5GB of data has been sent
Size of Object to be created - 5368710144 (5GB + 1KB)
content-length header set to - 5368710144
size of body (sent in repeated 8k sends out of httplib2) - 5368710144
-------
Actual Results
-------
-headers are sent
-endheader line is sent
-5GB of the body is sent
-Server returns 413 error
-------
Expected Results
-------
If I have told the server up front (with the content-length header) that I intend to send more than it will accept, I should get the 413 response before sending the body. When using chunked encoding, this behavior makes sense, but not when the content-length is declared in the PUT headers.
I've been unable to reproduce this issue using curl and have confirmed the code required to immediately return a response has been there for quite some time. After further examination using python-swiftclient and reading the httplib/httplib2 documentation I believe this is actually a limitation with those libraries. The complete request (including body) must be sent before the response can be retrieved. This is because the act of getting the response blocks waiting for the response itself. Under normal circumstances you won't get a response until the end of your upload, so attempting to get the response before sending the data itself causes things to wait indefinitely.