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

Bug #1011769 reported by Wayne Vestal Weeks
6
This bug affects 1 person
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.

Revision history for this message
Joshua Colp (jcolp) wrote :

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.

Revision history for this message
Tom Fifield (fifieldt) wrote :

Wayne - can you reproduce your error using curl ?

Changed in swift:
status: New → Incomplete
Revision history for this message
Mike Barton (redbo) wrote :

Exactly, it's a limitation of httplib where it doesn't know how to use "Expect: 100-continue" headers. That's the only way for HTTP requests to fail early. Curl I think does it by default when sending a PUT.

Of course expect headers add an extra RTT to requests, so if latency is important, you should probably just make sure your content is valid as best you can and forego that step.

Revision history for this message
Wayne Vestal Weeks (wayneweeks) wrote :

I've got some time away from compute today. I'll try for a curl recreation.

Revision history for this message
Mike Barton (redbo) wrote :

I presume if you do a PUT with curl and do a "-H Expect:" it'll turn off the expect header and will have to upload the whole file before getting a 413. That's not really something we can fix.

Revision history for this message
Wayne Vestal Weeks (wayneweeks) wrote :

You are correct. Curl creation was a pain for this since it wanted to hold all 5GB in memory, but it does error early on the 5GB boundary using curl.

Marked as Invalid

Changed in swift:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.