Bug 960999
Summary: | G4S: Ranged GET requests failes to respond properly to some byte range requests | ||
---|---|---|---|
Product: | [Community] Gluster-Swift | Reporter: | pushpesh sharma <psharma> |
Component: | Proxy-server | Assignee: | Nobody <nobody> |
Status: | VERIFIED --- | QA Contact: | David J. Mac Donald <david.macdonald> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 0.1 | CC: | bugs, david.macdonald |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | Type: | Bug | |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
pushpesh sharma
2013-05-08 13:45:11 UTC
Test Code:- def testRangedGets(self): file_length = 10000 range_size = file_length / 10 file = self.env.container.file(Utils.create_name()) data = file.write_random(file_length) for i in range(0, file_length, range_size): range_string = 'bytes=%d-%d' % (i, i + range_size - 1) hdrs = {'Range': range_string} self.assert_(data[i: i + range_size] == file.read(hdrs=hdrs), range_string) range_string = 'bytes=-%d' % (i) hdrs = {'Range': range_string} if i == 0: # RFC 2616 14.35.1 # "If a syntactically valid byte-range-set includes ... at # least one suffix-byte-range-spec with a NON-ZERO # suffix-length, then the byte-range-set is satisfiable. # Otherwise, the byte-range-set is unsatisfiable. self.assertRaises(ResponseError, file.read, hdrs=hdrs) self.assert_status(416) else: self.assertEquals(file.read(hdrs=hdrs), data[-i:]) range_string = 'bytes=%d-' % (i) hdrs = {'Range': range_string} self.assert_(file.read(hdrs=hdrs) == data[i - file_length:], range_string) range_string = 'bytes=%d-%d' % (file_length + 1000, file_length + 2000) hdrs = {'Range': range_string} self.assertRaises(ResponseError, file.read, hdrs=hdrs) self.assert_status(416) range_string = 'bytes=%d-%d' % (file_length - 1000, file_length + 2000) hdrs = {'Range': range_string} self.assert_(file.read(hdrs=hdrs) == data[-1000:], range_string) hdrs = {'Range': '0-4'} self.assert_(file.read(hdrs=hdrs) == data, range_string) # RFC 2616 14.35.1 # "If the entity is shorter than the specified suffix-length, the # entire entity-body is used." range_string = 'bytes=-%d' % (file_length + 10) hdrs = {'Range': range_string} self.assert_(file.read(hdrs=hdrs) == data, range_string) [root@dhcp207-5 swift]# rpm -qa|grep swift glusterfs-swift-3.3.1-13.fc18.noarch glusterfs-swift-container-3.3.1-13.fc18.noarch glusterfs-swift-account-3.3.1-13.fc18.noarch glusterfs-swift-object-3.3.1-13.fc18.noarch glusterfs-swift-proxy-3.3.1-13.fc18.noarch python-swiftclient-1.2.0-3.fc18.noarch [root@dhcp207-5 swift]# I can no longer reproduce it using http://build.gluster.org/job/gluster-swift-builds-cent6/lastSuccessfulBuild/artifact/build/glusterfs-openstack-swift-1.8.0-27.el6.noarch.rpm . Please confirm and close if there is no longer an issue. Verified: [root@heka-client-10 swift]# nosetests --exe test/functional/tests.py:TestFile.testRangedGets testRangedGets (test.functional.tests.TestFile) ... ok ---------------------------------------------------------------------- Ran 1 test in 0.410s OK Verified on gluster-swift glusterfs-openstack-swift-1.8.0-28.el6.noarch.rpm Issue no longer seen on the build:- [root@dhcp207-140 ~]# nosetests --exe ~/swift/test/functional/tests.py:TestFile.testRangedGets . ---------------------------------------------------------------------- Ran 1 test in 0.732s OK Verified using curl request:- #curl -v -X GET -H 'X-Auth-Token: AUTH_tkf9a56394870d4b6ea218809394abdf7f' https://10.65.207.140:443/v1/AUTH_test/dir/proxy-server.conf -k HTTP/1.1 200 OK < Content-Length: 2347 < Accept-Ranges: bytes < Last-Modified: Wed, 12 Jun 2013 19:26:56 GMT < Etag: 05b44fa17b60b24f34159052c4de23bb < X-Timestamp: 1371065216.90306 < Content-Type: application/octet-stream < Date: Wed, 12 Jun 2013 19:27:19 GMT < [DEFAULT] #bind_port = 8080 .. # curl -v -X GET -H 'X-Auth-Token: AUTH_tkf9a56394870d4b6ea218809394abdf7f' -H 'Range: bytes=-0' https://10.65.207.140:443/v1/AUTH_test/dir/proxy-server.conf -k HTTP/1.1 416 Requested Range Not Satisfiable < Content-Length: 0 < Accept-Ranges: bytes < Last-Modified: Wed, 12 Jun 2013 19:26:56 GMT < Etag: 05b44fa17b60b24f34159052c4de23bb < X-Timestamp: 1371065216.90306 < Content-Type: application/octet-stream < Date: Wed, 12 Jun 2013 19:28:07 GMT < * Connection #0 to host 10.65.207.140 left intact * Closing connection #0 #curl -v -X GET -H 'X-Auth-Token: AUTH_tkf9a56394870d4b6ea218809394abdf7f' -H 'Range: bytes=-3000' https://10.65.207.140:443/v1/AUTH_test/dir/proxy-server.conf -k < HTTP/1.1 206 Partial Content < Content-Length: 2347 < Accept-Ranges: bytes < Last-Modified: Wed, 12 Jun 2013 19:26:56 GMT < Content-Range: bytes 0-2346/2347 < Etag: 05b44fa17b60b24f34159052c4de23bb < X-Timestamp: 1371065216.90306 < Content-Type: application/octet-stream < Date: Wed, 12 Jun 2013 19:29:23 GMT < [DEFAULT] #bind_port = 8080 user = root # Consider using 1 worker per CPU workers = 1 bind_port = ..... |