Skip to content

Commit

Permalink
Merge pull request #1733 from mendersoftware/cherry-5.0.x-retry-mecha…
Browse files Browse the repository at this point in the history
…nism-fix

[Cherry 5.0.x]: fix: retry polling on all errors
  • Loading branch information
lluiscampos authored Jan 26, 2025
2 parents 1addbfe + ca97224 commit 80c9aae
Showing 1 changed file with 4 additions and 8 deletions.
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

0 comments on commit 80c9aae

Please sign in to comment.