-
Notifications
You must be signed in to change notification settings - Fork 39.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove PodBackoffMap #87948
Remove PodBackoffMap #87948
Conversation
/assign @alculquicondor |
/retest |
4 similar comments
/retest |
/retest |
/retest |
/retest |
|
||
// Override clock to exceed the DefaultPodInitialBackoffDuration so that unschedulable pods | ||
// will be moved to activeQ | ||
c.SetTime(timestamp.Add(DefaultPodInitialBackoffDuration + 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use c.Step
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we shouldn't be doing this. Is there a clearBackoff related to this that we removed? If so, we should probably also reset Attempts here? @Huang-Wei
maxDuration: maxDuration, | ||
podAttempts: make(map[ktypes.NamespacedName]int), | ||
podLastUpdateTime: make(map[ktypes.NamespacedName]time.Time), | ||
// NewPodBackoff creates a PodBackoff with initial duration and max duration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure we need this struct at all, those couple of variables can be part of PriorityQueue
, the couple of functions below are pretty short, so they can be methods under PriorityQueue
as well
045c407
to
63d7d8a
Compare
/retest |
Please avoid amending until we have finished reviewing. When you amend, we lose context of the ongoing discussions and we might have to review the whole PR again 😞 |
oh, sorry. I thought the code changed a lot, so I used a force push. Will remember next time. |
@@ -1201,6 +1206,22 @@ func TestPendingPodsMetric(t *testing.T) { | |||
} | |||
pInfos = append(pInfos, p) | |||
} | |||
totalWithDelay := 20 | |||
var pInfosWithDelay = make([]*framework.PodInfo, 0, totalWithDelay) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead, you could make the creation of podInfos a function that accepts the current timestamp.
Then, you would have the same steps that you are setting (add, step, add
), and some operands like:
pInfos(0, 20), nil, pInfos(20, 30)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the pInfos will be calculated before the execution of steps (add, step, add),
, so it can't get the current timestamp dynamically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a new func to avoid duplicate code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well operands could be functions instead of actual values, but this is good enough.
@@ -1589,11 +1607,67 @@ func TestBackOffFlow(t *testing.T) { | |||
} | |||
}) | |||
} | |||
// After some time, backoff information is cleared. | |||
cl.Step(time.Hour) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see this going away.
That's actually fair. No big deal. |
There a few other comments that you haven't addressed. Maybe you missed them because they were added to "resolved" threads? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resurfacing comments
@@ -380,8 +380,11 @@ func TestPriorityQueue_MoveAllToActiveQueue(t *testing.T) { | |||
addOrUpdateUnschedulablePod(q, q.newPodInfo(&unschedulablePod)) | |||
addOrUpdateUnschedulablePod(q, q.newPodInfo(&highPriorityPod)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove addOrUpdateUnschedulablePod
?
/approve @ahg-g anything to add? If not, we can squash. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, notpad The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
/hold for squash |
c79521a
to
a4e4a99
Compare
/retest |
1 similar comment
/retest |
/hold cancel great work @notpad, thanks |
/lgtm |
/retest Review the full test history for this PR. Silence the bot with an |
/priority important-longterm |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
The PodBackoffMap don't need to store pod attempts information because PodInfo already contains this data
Which issue(s) this PR fixes:
Fixes #87832
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/sig scheduling