Skip to content

Commit e8a5fc4

Browse files
committed
Include Prepared phase tasks in periodic enqueue to prevent stalling
Tasks in Prepared phase were not included in periodic enqueue (only Accepted phase was included). This meant they only received reconcile calls through watch events, which could cause them to get stuck for long periods when waiting for available slots. This change adds Prepared phase to the periodic enqueue predicate for both DataUpload and DataDownload controllers, ensuring they get regular reconcile calls (every minute via preparingMonitorFrequency). This is an alternative proposed solution to the issue described in vmware-tanzu#9447 Signed-off-by: Andrei Kvapil <[email protected]>
1 parent 99f12b8 commit e8a5fc4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

pkg/controller/data_download_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,12 @@ func (r *DataDownloadReconciler) SetupWithManager(mgr ctrl.Manager) error {
589589
return true
590590
}
591591

592+
// Include Prepared phase to ensure tasks get regular reconcile calls
593+
// This prevents tasks from getting stuck when they're waiting for slots
594+
if dd.Status.Phase == velerov2alpha1api.DataDownloadPhasePrepared {
595+
return true
596+
}
597+
592598
if dd.Spec.Cancel && !isDataDownloadInFinalState(dd) {
593599
return true
594600
}

pkg/controller/data_upload_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,12 @@ func (r *DataUploadReconciler) SetupWithManager(mgr ctrl.Manager) error {
632632
return true
633633
}
634634

635+
// Include Prepared phase to ensure tasks get regular reconcile calls
636+
// This prevents tasks from getting stuck when they're waiting for slots
637+
if du.Status.Phase == velerov2alpha1api.DataUploadPhasePrepared {
638+
return true
639+
}
640+
635641
if du.Spec.Cancel && !isDataUploadInFinalState(du) {
636642
return true
637643
}

0 commit comments

Comments
 (0)