Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: retry offline deal after commp errors #899

Merged
merged 5 commits into from
Nov 9, 2022
Merged

Conversation

LexLuthr
Copy link
Collaborator

fixes #895

@LexLuthr LexLuthr requested a review from dirkmc October 17, 2022 17:24
storagemarket/deal_commp.go Outdated Show resolved Hide resolved
Copy link
Contributor

@dirkmc dirkmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far, just a couple of suggestions

@LexLuthr LexLuthr requested a review from dirkmc October 18, 2022 16:29
retry: types.DealRetryManual,
error: fmt.Errorf("commP mismatch, expected=%s, actual=%s", clientPieceCid, pieceCid),
}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} else {

@@ -56,6 +65,13 @@ func (p *Provider) generatePieceCommitment(filepath string, pieceSize abi.Padded
var err error
pi, err = GenerateCommP(filepath)
if err != nil {
// Allow auto retry to cover cases where IO copy fails due to lack of space
if strings.Contains(err.Error(), "failed to write to CommP writer") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing string matching on the error string, let's use a custom error.
See for example ErrDealHandlerNotFound

if errors.Is(err, storagemarket.ErrDealHandlerNotFound) {

@dirkmc
Copy link
Contributor

dirkmc commented Oct 19, 2022

Could you please also add some cases to TestDealAutoRestartAfterAutoRecoverableErrors and TestDealRestartAfterManualRecoverableErrors (or create new tests if that's simpler) to verify that the changes you've made work correctly. The existing tests are in storagemarket/provider_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow retry for offline deals in case of commp mismatch
2 participants