clarify exception message when bulk tarfile read errors occur in proxy PUT path

Bug #1704390 reported by Alistair Coles
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
New
Low
Unassigned

Bug Description

Bulk middleware can raise a tarfile.ReadError which is not explicitly handled in the proxy object controller PUT path so ends up being handled by the catch-all except clause [1] resulting in a log message "proxy-server: ERROR Exception transferring data to object servers" [2]. This is technically correct (the method is transferring data from the source to the object servers) but in contrast to the other error logs that might be raised in that method (e.g. "Client disconnected without sending last chunk"), this one suggests a problem in the proxy-backend communication, which is not the current case.

Possible solutions include:
1. catch the ReadError in bulk middleware and convert to a swift exception (ChunkReadError perhaps?). The core proxy code shouldn't need to know about tarfile exceptions.
2. change the error message if it only ever relates to *reading* errors rather than sending errors (requires further research).

[1] https://github.com/openstack/swift/blob/c3f6e82ae1ec2a9f0215a26655539527354e6eac/swift/proxy/controllers/obj.py#L2637-L2641

[2]
proxy-server: ERROR Exception transferring data to object servers {'path': XXXXXX}:
Traceback (most recent call last):
 File "/opt/ss/lib/python2.7/site-packages/swift/proxy/controllers/obj.py", line 792, in _transfer_data
 chunk = next(data_source)
 File "/opt/ss/lib/python2.7/site-packages/swift/proxy/controllers/obj.py", line 672, in reader
 self.app.client_chunk_size)
 File "/opt/ss/lib/python2.7/site-packages/swift/common/middleware/crypto/encrypter.py", line 177, in read
 return self.readChunk(self.wsgi_input.read, *args, **kwargs)
 File "/opt/ss/lib/python2.7/site-packages/swift/common/middleware/crypto/encrypter.py", line 183, in readChunk
 chunk = read_method(*args, **kwargs)
 File "/opt/ss/lib/python2.7/tarfile.py", line 831, in read
 buf += self.fileobj.read(size - len(buf))
 File "/opt/ss/lib/python2.7/tarfile.py", line 743, in read
 return self.readnormal(size)
 File "/opt/ss/lib/python2.7/tarfile.py", line 758, in readnormal
 return self.__read(size)
 File "/opt/ss/lib/python2.7/tarfile.py", line 750, in __read
 raise ReadError("unexpected end of data")
ReadError: unexpected end of data (txn: tx28f302bb927c4f8c8XXXXXXXXXXXX) (client_ip: XXXX)

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.