mirror of
https://github.com/rclone/rclone.git
synced 2026-10-06 13:02:30 -04:00
Each upload chunk is buffered in a pool.RW from the global memory pool but was never closed, so its pages were never returned to the pool. Close the buffer after each chunk is uploaded and on the read error path. A chunk that failed with a retryable error was also retried without rewinding the buffer, so the retry sent an empty body with the original Content-Length and Content-Range and failed. Seek the chunk back to the start inside the pacer closure so each attempt re-sends it in full. The FsPutRetry integration test covers the retry of a failed upload request and checks the buffers are returned to the pool.