R2 range request bug on large files

When trying to multithreaded download of a larger file from a R2 bucket, the range requests randomly fail.

Aria2 detects it nicely and aborts those threads. In my case, usually about 3 threads fail out of 8 parallel downloads. The 5 leftover threads nicely finish the full file, so this is not critical, but something is definitely not working correctly on large files.

The bucket is properly shared as a custom domain, not using r2.dev.

01/02 18:47:03 [e[1;31mERRORe[0m] CUID#10 - Download aborted. URI=https://xxx/20231221_134737_pt/tiles.btrfs.gz
Exception: [AbstractCommand.cc:351] errorCode=8 URI=https://xxx/20231221_134737_pt/tiles.btrfs.gz
  -> [HttpResponse.cc:81] errorCode=8 Invalid range header. Request: 20326645760-30490492927/81305816500, Response: 0-81305816499/81305816500

01/02 18:47:03 [e[1;31mERRORe[0m] CUID#13 - Download aborted. URI=https://xxx/20231221_134737_pt/tiles.btrfs.gz
Exception: [AbstractCommand.cc:351] errorCode=8 URI=https://xxx/20231221_134737_pt/tiles.btrfs.gz
  -> [HttpResponse.cc:81] errorCode=8 Invalid range header. Request: 30490492928-40653291519/81305816500, Response: 0-81305816499/81305816500
[#c04dfb 103MiB/75GiB(0%) CN:6 DL:78MiB ETA:16m32s]

01/02 18:47:04 [e[1;31mERRORe[0m] CUID#15 - Download aborted. URI=https://xxx/20231221_134737_pt/tiles.btrfs.gz
Exception: [AbstractCommand.cc:351] errorCode=8 URI=https://xxx/20231221_134737_pt/tiles.btrfs.gz
  -> [HttpResponse.cc:81] errorCode=8 Invalid range header. Request: 71143784448-81305816499/81305816500, Response: 0-81305816499/81305816500

Since the extension is cacheable, you may be hitting this bug: