Skip to content

Commit

Permalink
[Bugfix] Don't abort plan in case of optional action timeout (#1573)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-vanyasin authored Jan 15, 2024
1 parent 51551e5 commit 1dc660e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions pkg/deployment/reconcile/plan_executor.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1dc660e

Please sign in to comment.