Hello there,
I am using the library, indirectly via python-storage, in maybe an unorthodox way: I am trying to implement a download timeout via a custom http adapter and response.
So my response object is throwing pro-actively timeouts (common.InvalidResponse with http.client.REQUEST_TIMEOUT),
which is forcibly triggering the retry logic in the Download class:
All goes well, but one thing: the final results content data from both the partial content of prematurely aborted request and the final and complete data of the second request.
It happens because both dataset are accumulated in the _stream above.
Do you agree it's bug and that on retry the _stream shall be resetted (e.g. seek(0))? Do I miss a use case where it makes sense to accumulated data, or we were just assuming data would be empty anyway on exception?
If I did not miss anything I'll submit a PR to fix it.
Many thanks in advance.
Fred
Hello there,
I am using the library, indirectly via python-storage, in maybe an unorthodox way: I am trying to implement a download timeout via a custom http adapter and response.
So my response object is throwing pro-actively timeouts (common.InvalidResponse with http.client.REQUEST_TIMEOUT),
which is forcibly triggering the retry logic in the Download class:
google-resumable-media-python/google/resumable_media/requests/download.py
Line 164 in d082772
All goes well, but one thing: the final results content data from both the partial content of prematurely aborted request and the final and complete data of the second request.
It happens because both dataset are accumulated in the
_streamabove.Do you agree it's bug and that on retry the _stream shall be resetted (e.g. seek(0))? Do I miss a use case where it makes sense to accumulated data, or we were just assuming data would be empty anyway on exception?
If I did not miss anything I'll submit a PR to fix it.
Many thanks in advance.
Fred