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

fix: retry polling on all errors #1730

Merged
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
12 changes: 4 additions & 8 deletions src/mender-update/daemon/states.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,8 @@ void SubmitInventoryState::DoSubmitInventory(Context &ctx, sm::EventPoster<State
auto handler = [this, &ctx, &poster](error::Error err) {
if (err != error::NoError) {
log::Error("Failed to submit inventory: " + err.String());
if (err.code != auth::MakeError(auth::UnauthorizedError, "").code) {
// Replace the inventory poll timer with a backoff
HandlePollingError(ctx, poster);
}
// Replace the inventory poll timer with a backoff
HandlePollingError(ctx, poster);
poster.PostEvent(StateEvent::Failure);
return;
}
Expand Down Expand Up @@ -261,10 +259,8 @@ void PollForDeploymentState::OnEnter(Context &ctx, sm::EventPoster<StateEvent> &
[this, &ctx, &poster](mender::update::deployments::CheckUpdatesAPIResponse response) {
if (!response) {
log::Error("Error while polling for deployment: " + response.error().String());
if (response.error().code != auth::MakeError(auth::UnauthorizedError, "").code) {
// Replace the update poll timer with a backoff
HandlePollingError(ctx, poster);
}
// Replace the update poll timer with a backoff
HandlePollingError(ctx, poster);
poster.PostEvent(StateEvent::Failure);
return;
} else if (!response.value()) {
Expand Down