Skip to content

Contract of MarkNotComplete (and MarkComplete) in PieceImpl #921

Answered by anacrolix
mahesh-hegde asked this question in Q&A
Discussion options

You must be logged in to vote

What's the contract of MarkNotComplete?

It's called when the piece is known to not be complete. That is it's either missing or failed a piece check.

Once a PieceImpl instance is marked as incomplete using MarkIncomplete will its ReaderAt/WriterAt methods be used again?

Yes, ReaderAt is used in the piece hashing when all the chunks have been downloaded again. WriterAt is used to write them to storage.

In my understanding, MarkNotComplete is only failed when hashing fails. is there other scenarios I should consider?

A Reader attempted to read the data in the piece and got an unexpected EOF.

Same question for the semantics of MarkComplete(), once its called, might the same instance of…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mahesh-hegde
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants