Open colinmarc opened 1 year ago
I haven't tested the case where hash checks fail. A unit test for this would be fantastic and easy to do. Let me know if you're interested, or I can create one.
There isn't really any errors exposed at the moment, this would be a good case to expose one. Let me know if you have thoughts on how that should look. The only existing precedent I think for something like this is https://pkg.go.dev/github.com/anacrolix/torrent#Torrent.SetOnWriteChunkError. I expect this could be generalized to serious errors like this case.
It's possible to get a torrent into an infinite error loop. For example, if you
chown -R root /tmp/torrents
and then try to run the default file storage over that directory, the torrent client will just spew errors forever like:Is there a way for a caller to detect that the torrent is in an errored state and cancel it, or at least report that to the user?