Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

kube-runtime: fix exponential backoff max times #1713

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

eliad-wiz
Copy link
Contributor

backon's ExponentialBuilder::default() uses max_times=Some(3), which means it will give up after 3 times.

call without_max_times() in order to avoid it.
this matches the previous backoff-based implementation that called .with_max_elapsed_time(None)

additionally, save the actual builder which contains all the relevant params, so we could reset it easily (the current implementation has another bug where it doesn't use the same params in new() and reset()).

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 75.8%. Comparing base (4378212) to head (ac786b3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
kube-runtime/src/watcher.rs 0.0% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1713     +/-   ##
=======================================
+ Coverage   75.8%   75.8%   +0.1%     
=======================================
  Files         84      84             
  Lines       7746    7743      -3     
=======================================
  Hits        5866    5866             
+ Misses      1880    1877      -3     
Files with missing lines Coverage Δ
kube-runtime/src/watcher.rs 43.2% <0.0%> (+0.6%) ⬆️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ExponentialBuilder::default() uses max_times=Some(3), which means
it will give up after 3 times.

call without_max_times() in order to avoid it. this matches the
previous backoff-based implementation that called .with_max_elapsed_time(None)

additionally, save the actual builder which contains all the relevant params,
so we could reset it easily (the current implementation didn't use the
same params in new() and reset()).

Signed-off-by: Eliad Peller <eliad.peller@wiz.io>
@eliad-wiz eliad-wiz force-pushed the fix-exponential-backoff branch from cd992ca to ac786b3 Compare March 5, 2025 13:51
Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. thank you!

@clux clux changed the title kube-runtime: fix exponential backoff kube-runtime: fix exponential backoff max times Mar 6, 2025
@clux clux added the changelog-fix changelog fix category for prs label Mar 6, 2025
@clux clux added this to the 0.99.0 milestone Mar 6, 2025
@clux clux merged commit 4234e8a into kube-rs:main Mar 6, 2025
17 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
changelog-fix changelog fix category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants