From 1dc660ec5a4ba3e425ad3f8c418fe57dff5f20cc Mon Sep 17 00:00:00 2001 From: Nikita Vaniasin Date: Mon, 15 Jan 2024 12:56:48 +0100 Subject: [PATCH] [Bugfix] Don't abort plan in case of optional action timeout (#1573) --- CHANGELOG.md | 1 + pkg/deployment/reconcile/plan_executor.go | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 026d68032..ebf681fda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - (Maintenance) Reduce binary size - (Maintenance) Update Features Description, Supported K8S Versions and K8S Dependency to 1.28.5 - (Feature) (ML) Featurization Job Type +- (Bugfix) Don't abort plan in case of optional action timeout ## [1.2.36](https://github.com/arangodb/kube-arangodb/tree/1.2.36) (2024-01-08) - (Documentation) Improvements and fixes for rendered documentation (GH pages) diff --git a/pkg/deployment/reconcile/plan_executor.go b/pkg/deployment/reconcile/plan_executor.go index 46b120104..c1c8ff704 100644 --- a/pkg/deployment/reconcile/plan_executor.go +++ b/pkg/deployment/reconcile/plan_executor.go @@ -1,7 +1,7 @@ // // DISCLAIMER // -// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany +// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -397,10 +397,14 @@ func (d *Reconciler) executeAction(ctx context.Context, planAction api.Action, a d.context.CreateEvent(k8sutil.NewPlanAbortedEvent(d.context.GetAPIObject(), string(planAction.Type), planAction.MemberID, planAction.Group.AsRole())) return false, true, false, false, nil } else if isActionTimeout(timeout, planAction) { + if planAction.Type.Optional() { + log.Warn("Optional action not finished in time. Skipping") + return true, false, false, false, nil + } + log.Warn("Action not finished in time. Removing the entire plan") d.context.CreateEvent(k8sutil.NewPlanTimeoutEvent(d.context.GetAPIObject(), string(planAction.Type), planAction.MemberID, planAction.Group.AsRole())) return false, true, false, false, nil - } // Timeout not yet expired, come back soon