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

sabakan-cryptsetup: retry sabakan API calls. #171

Merged
merged 3 commits into from
Aug 23, 2019
Merged

sabakan-cryptsetup: retry sabakan API calls. #171

merged 3 commits into from
Aug 23, 2019

Conversation

ymmt2005
Copy link
Member

No description provided.

@ymmt2005 ymmt2005 self-assigned this Aug 23, 2019
@ymmt2005 ymmt2005 marked this pull request as ready for review August 23, 2019 07:20
@ymmt2005 ymmt2005 requested a review from tapih August 23, 2019 07:21
return err
}
retries++
time.Sleep(time.Duration(retries) * time.Second * 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to confirm, do you intend to make sleep time longer if retry happens multiple times?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.

if retries == maxRetry {
return err
}
retries++
Copy link
Contributor

Choose a reason for hiding this comment

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

retries++ should be before if retries == maxRetry block or else retry happens (maxRetry + 1) times.

Copy link
Member Author

Choose a reason for hiding this comment

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

No. Retries can happen exactly at most maxRetry times.
Note that the first try is not a retry.

if retries == maxRetry {
return err
}
retries++
Copy link
Contributor

Choose a reason for hiding this comment

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

same here.

@ymmt2005 ymmt2005 requested a review from tapih August 23, 2019 08:03
Copy link
Contributor

@tapih tapih left a comment

Choose a reason for hiding this comment

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

LGTM

@tapih tapih merged commit 8c1db06 into master Aug 23, 2019
@tapih tapih deleted the robust branch August 23, 2019 08:07
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.

None yet

2 participants