Repository navigation
Conversation
When two connections return different bytes for the same offset, keep the matching prefix and finish on one connection. If that copy disagrees too, discard the partial file and start again from the first byte.
troke12
left a comment
There was a problem hiding this comment.
Thanks for the effort here, but I don't think we'll take this one:
- The 64-byte boundary witnesses live only in memory and are cleared on pause, so a boundary that wasn't verified before a pause is never compared after resume — the inconsistent-backend case this targets can still slip through silently.
d.file.ReadAtruns underd.mu, which the UI also takes.restartedresets on everyStart, so a server that always disagrees loops forever across pause/resume.- Detection only samples chunk boundaries; the README wording overstates it.
The main real-world case (file replaced mid-download) is better covered by If-Range (#2), and the pass-loop machinery overlaps with #10. Happy to reconsider if there's a concrete server that needs it.
Note for the whole set (#1–#11): thanks a lot for these! They are all branched from 5350f79 independently, so every pair conflicts on CHANGELOG.md and most on download.go. main has also moved (e830f5d adds a stream downloader that touches download.go). Could you rebase onto current main and stack them in this order: #1 → #2 → #10 → #8 → #5/#6/#7/#11? #2, #3 and #10 each add their own pass loop / transferCancel in Start; one shared design would be much easier to merge.
|
Closing per the review above: the boundary witnesses are lost on pause and the restart flag resets each Start (so a disagreeing server can loop), and the main real-world case — a file replaced mid-download — is being covered by If-Range in #2, with the one-connection fallback from #10. Thanks a lot for the work; happy to reopen if a concrete server turns up that needs this. |
Summary
When two connections receive different bytes for the same offset, ODM stops the extra connections and finishes the file on one. If that copy disagrees as well, the partial file is discarded and the download starts again from the first byte, still on one connection.
Behavior
singlein the saved state). Consistent ranges still use every configured connection.Test plan
go test ./...(65 tests)