44 "fmt"
55 "time"
66
7- "github.com/armadaproject/armada/internal/common/preemption"
8- "github.com/armadaproject/armada/internal/scheduler/configuration"
9-
107 "github.com/hashicorp/go-multierror"
118 "github.com/pkg/errors"
129 "golang.org/x/exp/maps"
@@ -15,6 +12,7 @@ import (
1512
1613 "github.com/armadaproject/armada/internal/common/constants"
1714 armadamaps "github.com/armadaproject/armada/internal/common/maps"
15+ "github.com/armadaproject/armada/internal/common/preemption"
1816 "github.com/armadaproject/armada/internal/common/types"
1917 "github.com/armadaproject/armada/internal/scheduler/adapters"
2018 "github.com/armadaproject/armada/internal/scheduler/internaltypes"
@@ -846,9 +844,9 @@ func (job *Job) NumAttempts() uint {
846844// IsEligibleForPreemptionRetry determines whether the job is eligible for preemption retries. It checks whether the
847845// scheduler or the job has opted in for preemption retries. It then checks whether the job has exhausted the number
848846// of retries.
849- func (job * Job ) IsEligibleForPreemptionRetry (defaultPreemptionRetryConfig configuration. PreemptionRetryConfig ) bool {
847+ func (job * Job ) IsEligibleForPreemptionRetry (retryConfig preemption. RetryConfig ) bool {
850848 // Check if job explicitly enabled/disabled retries, falling back to platform default
851- enabled := defaultPreemptionRetryConfig .Enabled
849+ enabled := retryConfig .Enabled
852850 if jobRetryEnabled , exists := preemption .AreRetriesEnabled (job .Annotations ()); exists {
853851 enabled = jobRetryEnabled
854852 }
@@ -857,7 +855,7 @@ func (job *Job) IsEligibleForPreemptionRetry(defaultPreemptionRetryConfig config
857855 return false
858856 }
859857
860- return job .NumPreemptedRuns () <= job .MaxPreemptionRetryCount (defaultPreemptionRetryConfig )
858+ return job .NumPreemptedRuns () <= job .MaxPreemptionRetryCount (retryConfig )
861859}
862860
863861func (job * Job ) NumPreemptedRuns () uint {
@@ -870,11 +868,11 @@ func (job *Job) NumPreemptedRuns() uint {
870868 return preemptCount
871869}
872870
873- func (job * Job ) MaxPreemptionRetryCount (defaultPreemptionRetryConfig configuration. PreemptionRetryConfig ) uint {
871+ func (job * Job ) MaxPreemptionRetryCount (retryConfig preemption. RetryConfig ) uint {
874872 // Start with platform default
875873 var maxRetryCount uint
876- if defaultPreemptionRetryConfig . DefaultMaxRetryCount != nil {
877- maxRetryCount = * defaultPreemptionRetryConfig . DefaultMaxRetryCount
874+ if retryConfig . DefaultRetryCount != nil {
875+ maxRetryCount = * retryConfig . DefaultRetryCount
878876 }
879877
880878 // Allow jobs to override with a custom max retry count
0 commit comments