From ca97224d6d453e2621411e5a974780a150b1edbf Mon Sep 17 00:00:00 2001 From: Daniel Skinstad Drabitzius Date: Wed, 22 Jan 2025 09:44:09 +0100 Subject: [PATCH] fix: retry polling on all errors When implementing the backoff for errors when polling for deployment or submitting inventory, we added an exception for unauthorized errors. After looking at how it was done in Mender Client 3, we discovered that such an exception was not present there, and that the backoff should be triggered for all types of errors. Changelog: All errors on attempts to communicate with the server are retried with an exponential backoff. This aligns the behavior of the state machine with Mender Client 3. Ticket: MEN-7938 Signed-off-by: Daniel Skinstad Drabitzius (cherry picked from commit 45f88a13e6eb1b7e8f4b8c65eba6cccb6030f2b7) --- src/mender-update/daemon/states.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/mender-update/daemon/states.cpp b/src/mender-update/daemon/states.cpp index a3e5a3676..f469c19a8 100644 --- a/src/mender-update/daemon/states.cpp +++ b/src/mender-update/daemon/states.cpp @@ -149,10 +149,8 @@ void SubmitInventoryState::DoSubmitInventory(Context &ctx, sm::EventPoster & [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()) {