Skip to content
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

Fix potentially panicing unchecked duration adds in runtime #1489

Merged
merged 2 commits into from
May 10, 2024

Conversation

clux
Copy link
Member

@clux clux commented May 9, 2024

Fixes #1488. Searched a lot and found 3 potential cases.

Prevents pathological overlows of Instant + Duration with now() defaulted use of Instant::checked_add.

This should only really affect anyone that are passing enormous numbers to requeue in reconcilers (in which case, you should probably use Action::await_change instead), the underlying bug report was found to cast a small negative number to an unsigned to cause this.

@clux clux added the changelog-fix changelog fix category for prs label May 9, 2024
Copy link

codecov bot commented May 9, 2024

Codecov Report

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

Project coverage is 74.9%. Comparing base (22cb4a4) to head (2f30a01).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1489     +/-   ##
=======================================
- Coverage   74.9%   74.9%   -0.0%     
=======================================
  Files         78      78             
  Lines       6801    6806      +5     
=======================================
  Hits        5091    5091             
- Misses      1710    1715      +5     
Files Coverage Δ
kube-runtime/src/controller/mod.rs 29.9% <ø> (ø)
kube-runtime/src/scheduler.rs 95.1% <50.0%> (-2.0%) ⬇️

@clux clux marked this pull request as ready for review May 9, 2024 19:26
@clux clux added this to the 0.92.0 milestone May 9, 2024
@clux clux merged commit 3170f68 into main May 10, 2024
18 checks passed
@clux clux deleted the checked-add-runtime branch May 10, 2024 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-fix changelog fix category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unchecked add of instant + duration is causing a panic.
2 participants