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

Tokens fail to retry due to empty nonce #4146

Merged
merged 1 commit into from
Dec 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,19 @@ void RefillTokens::Refill(

public_key_ = public_key;

nonce_ = "";
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems unnecessary in the constructor, but fine by me if you'd just like to be explicit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need the nonce to reset if starting without the need to retry

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it, I misread this as being the class's constructor. Sorry!


RequestSignedTokens();
}

void RefillTokens::RetryGettingSignedTokens() {
BLOG(INFO) << "Retry getting signed tokens";

if (nonce_.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any danger of endlessly retriggering this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is, however right now we have no retry count so I will raise a ticket

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, good idea.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

RequestSignedTokens();
return;
}

GetSignedTokens();
}

Expand Down Expand Up @@ -309,8 +316,8 @@ void RefillTokens::OnRefill(
BLOG(ERROR) << "Failed to refill tokens";

if (should_retry) {
confirmations_->StartRetryingToGetRefillSignedTokens(
kRetryGettingRefillSignedTokensAfterSeconds);
confirmations_->StartRetryingToGetRefillSignedTokens(
kRetryGettingRefillSignedTokensAfterSeconds);
}

return;
Expand Down