Streaming reads of an object sometimes truncates silently

Bug #1819544 reported by Konrad Listwan-Ciesielski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-swiftclient
New
Undecided
Unassigned

Bug Description

When streaming an object from Swift in chunks, it will sometimes silently finish even though not all bytes have been read. It's unclear what circumstances causes this to happen, but we've had this happen in a production environment a non-trivial number of times.

Using python-swiftclient 3.4.0. Here is a code sample where we've since added an MD5 check after reads to ensure what we've read matches what is on Swift:

    CHUNK_SIZE = 8388608
    ret_url, token = swift_auth(auth_url, user, password, storage_url)
    metadata, data = swift.get_object(ret_url, token, container, key, resp_chunk_size=CHUNK_SIZE)
    read_from_swift_md5 = hashlib.md5()
    data_chunk = data.read(CHUNK_SIZE)
    read_from_swift_md5.update(data_chunk)
    while data_chunk:
        data_chunk = data.read(CHUNK_SIZE)
        read_from_swift_md5.update(data_chunk)
    assert metadata.get('etag') == read_from_swift_md5.hexdigest()

Unsure if this is the same issue as https://bugs.launchpad.net/python-swiftclient/+bug/1389972

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.