EC: Chunked transfer/commit protocol is *not* HTTP

Bug #1496636 reported by clayg
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
In Progress
Medium
Pete Zaitcev

Bug Description

... and eventlet has a bug in the send_hundred_continue_response method that breaks WSGI semantics.

If you go tcp dumping an EC PUT, or look at some of the unittests [1], or read the relevant code [2] - you'll notice that right in the middle of a chunked transfer request - we send "0\r\n\r\n" - which in HTTP protocol land means - that's the end. As in "the next thing on the wire will be the headers of the next request".

So, we don't talk HTTP between the proxy and object servers anymore - which seems like that'll bite us.

Also eventlet wsgi is only *allowing* this insane behavior because of other code we slipped in on them to allow setting 100 continue headers. But unfortunately we also broke WSGI. Being able to read from wsgi.input after the end of the request body (i.e. server receives "0\r\n\r\n") means you could read into the next request - which is all kinds of wrong, and is normally prevented - unless you break it [3].

Either way, we can't fix eventlet until we fix swift or we break the world - so we're sort of in a sticky wicket.

1. https://github.com/openstack/swift/blob/f4e6d39d4f61ca4e495ace15c1edfe7564dfea75/test/unit/obj/test_server.py#L5362
2. https://github.com/openstack/swift/blob/f4e6d39d4f61ca4e495ace15c1edfe7564dfea75/swift/proxy/controllers/obj.py#L1711 <- imagine what this would format too if you self.queue.put('') like send_commit_confirmation does.
3. https://github.com/eventlet/eventlet/blob/5a4a7ead2435025e2c727c902d7e985be0204417/eventlet/wsgi.py#L118 <- I can't even imagine how wrong this would be on a non-chunked transfer request that accidentally called set_hundered_continue_headers after having started to read some amount of the body

Tags: ec golang
Revision history for this message
Tim Burke (1-tim-z) wrote :
Changed in swift:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Pete Zaitcev (zaitcev)
Tim Burke (1-tim-z)
tags: added: golang
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.