contour icon indicating copy to clipboard operation
contour copied to clipboard

internal/status: Avoid meaningless Condition changes

Open evankanderson opened this issue 3 years ago • 6 comments

No longer automatically perform a Status update on any call to AddCondition.

I recently noticed in my cluster that my HTTPRoute objects had updates to status.parents.conditions[Valid].LastTransitionTime once per second. In turn, this triggered my own reconcilers to check out the changes, adding load to the cluster and churn on etcd.

I could see an argument for updating the anonymous function in RouteConditionsAccessor in cache.go instead of AddCondition -- I don't have a strong feeling one way or the other.

evankanderson avatar Jul 01 '22 23:07 evankanderson

Codecov Report

Merging #4607 (754f522) into main (408b470) will decrease coverage by 0.03%. The diff coverage is 50.00%.

:exclamation: Current head 754f522 differs from pull request most recent head 01975a7. Consider uploading reports for the commit 01975a7 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4607      +/-   ##
==========================================
- Coverage   76.81%   76.77%   -0.04%     
==========================================
  Files         140      140              
  Lines       12993    12997       +4     
==========================================
- Hits         9980     9978       -2     
- Misses       2751     2756       +5     
- Partials      262      263       +1     
Impacted Files Coverage Δ
internal/status/routeconditions.go 22.22% <50.00%> (+1.63%) :arrow_up:
internal/sorter/sorter.go 96.38% <0.00%> (-2.41%) :arrow_down:

codecov[bot] avatar Jul 02 '22 04:07 codecov[bot]

/hold

I'm not sure that this is working; I tried applying it to my cluster (I might have screwed that up), but I'm still seeing condition updates.

evankanderson avatar Jul 05 '22 21:07 evankanderson

The change makes sense to me, seems like it should be more efficient. I'll wait for @evankanderson to update before pushing the approve button though.

youngnick avatar Jul 05 '22 22:07 youngnick

Marking this PR stale since there has been no activity for 14 days. It will be closed if there is no activity for another 30 days.

github-actions[bot] avatar Jul 20 '22 00:07 github-actions[bot]

ping @evankanderson - do you still want to go ahead here?

youngnick avatar Jul 25 '22 06:07 youngnick

Marking this PR stale since there has been no activity for 14 days. It will be closed if there is no activity for another 30 days.

github-actions[bot] avatar Aug 09 '22 00:08 github-actions[bot]