fsspec / gcsfs

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

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

Closed Metamess closed 4 months ago

Metamess commented 4 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 4 months ago

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

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

martindurant commented 4 months ago

Ping me next week

rabernat commented 4 months ago

Ping for a release! 🙏

Thanks for your work Martin.