fsspec / gcsfs

Pythonic file-system interface for Google Cloud Storage
http://gcsfs.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
345 stars 146 forks source link

Add seek(0) to request data to prevent issues on retries #624

Closed Metamess closed 6 months ago

Metamess commented 6 months ago

Closes #621

Credits go to @martindurant for the code.

When a simple_upload request fails but the data BytesIO stream was fully consumed, the retry attempt may fail because it does not send any data in the retried request. This PR attempt to fix that by always performing a seek(0) before starting the request.

rabernat commented 6 months ago

Thanks for this fix @Metamess! We have hit the same bug! 🙏

@martindurant would be wonderful to get a release asap. 🙏

martindurant commented 6 months ago

Ping me next week

rabernat commented 5 months ago

Ping for a release! 🙏

Thanks for your work Martin.