karmada icon indicating copy to clipboard operation
karmada copied to clipboard

priority: backoffQ heap algorithm uses backoff completed time to sort bindings

Open zhzhuang-zju opened this issue 8 months ago • 7 comments

What type of PR is this? /kind bug

What this PR does / why we need it: This PR includes:

  1. The sorting of elements in the BackOff queue should be based on the binding's expiry rather than its priority. Otherwise, bindings whose BackOff period has ended might not be scheduled on time.

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


zhzhuang-zju avatar Mar 20 '25 09:03 zhzhuang-zju

cc @whitewindmills Please take a look~

zhzhuang-zju avatar Mar 20 '25 09:03 zhzhuang-zju

thanks, so quickly, I'll take a look tomorrow. /assign

whitewindmills avatar Mar 20 '25 09:03 whitewindmills

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 49.42%. Comparing base (e2f0e6e) to head (956b2c4).

Files with missing lines Patch % Lines
pkg/scheduler/internal/queue/scheduling_queue.go 55.55% 4 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6216      +/-   ##
==========================================
+ Coverage   49.33%   49.42%   +0.08%     
==========================================
  Files         678      678              
  Lines       55122    55130       +8     
==========================================
+ Hits        27195    27247      +52     
+ Misses      26156    26110      -46     
- Partials     1771     1773       +2     
Flag Coverage Δ
unittests 49.42% <63.63%> (+0.08%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Mar 20 '25 09:03 codecov-commenter

/lgtm /cc @RainbowMango do you want to take a look?

whitewindmills avatar Mar 21 '25 09:03 whitewindmills

ok. /assign

RainbowMango avatar Mar 22 '25 02:03 RainbowMango

New changes are detected. LGTM label has been removed.

karmada-bot avatar Mar 22 '25 08:03 karmada-bot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from rainbowmango. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

karmada-bot avatar Mar 22 '25 08:03 karmada-bot

Will be tracked and completed by the new pr https://github.com/karmada-io/karmada/pull/6987

zhzhuang-zju avatar Dec 02 '25 08:12 zhzhuang-zju

@zhzhuang-zju Hey, I just realized this PR actually already fixes the incorrect sorting function in backoffQ — wondering why it hasn’t been merged yet? 🤣

rayo1uo avatar Dec 02 '25 09:12 rayo1uo

@rayo1uo Hah, great minds think alike! I also discovered the issue by reading the source code back then, so when I saw your PR, it felt very familiar—and pleasantly surprising!

As for why it wasn’t merged, it was mainly because I didn’t follow up actively afterward—there’s no special reason behind it. I’ll gladly help review and push for your PR to get merged!

zhzhuang-zju avatar Dec 02 '25 09:12 zhzhuang-zju

I totally missed this after the first round of review. Sorry. But glad and thanks to @rayo1uo for bringing this up.

RainbowMango avatar Dec 02 '25 11:12 RainbowMango