Sanity check GC revision timeout#4245
Conversation
knative-prow-robot
left a comment
There was a problem hiding this comment.
@greghaynes: 1 warning.
Details
In response to this:
If revision timeout is set below route resync period our gc controller
will GC revisions before they are able to receive a heartbeat.Fixes: #4234
Release Note
NONE
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
3518665 to
21c7e2b
Compare
85f6868 to
e51f97d
Compare
| func SanityCheckedConfigMapLoader(minRevisionTimeout time.Duration) func(configMap *corev1.ConfigMap) (*Config, error) { | ||
| return func(configMap *corev1.ConfigMap) (*Config, error) { | ||
| cfg, err := NewConfigFromConfigMap(configMap) | ||
| if cfg != nil && cfg.StaleRevisionTimeout < minRevisionTimeout { |
There was a problem hiding this comment.
We do not need to check cfg.StaleRevisionTimeout - cfg.StaleRevisionLastpinnedDebounce < minRevisionTimeout?
It looks like lastPinned annotation is skipped to update until StaleRevisionLastpinnedDebounce here:
serving/pkg/reconciler/route/reconcile_resources.go
Lines 281 to 284 in f50908d
There was a problem hiding this comment.
It looks like this comment already warns about it.
Lines 44 to 45 in f50908d
|
I am prefer to this PR rather than mine (#4235). But I have one concern. |
| return &c, nil | ||
| } | ||
|
|
||
| // SanityCheckedConfigMapLoader provides sanity checking for minRevisionTimeout and returns an error if this value is invalid |
There was a problem hiding this comment.
Can we just change NewConfigFromConfigMap to add this validation? This is generally where we do this sort of validation.
There was a problem hiding this comment.
The issue is ResyncPeriod is a variable and we need to supply a constructor to the ConfigStore which is of type func(*k8s.io/api/core/v1.ConfigMap) (*Config , error). The alternative way I can see Is to make NewConfigFromConfigMap a method on a struct which stores the ResyncPeriod.
There was a problem hiding this comment.
I am curious why NewConfigFromConfigMap needs this signature if the return value of this function does? Can't this just be curried? e.g. time.Duration -> *corev1.ConfigMap -> (*Config, error)?
There was a problem hiding this comment.
Can't wait for the haskell rewrite :)
3734048 to
b5ee977
Compare
|
/test pull-knative-serving-upgrade-tests |
If revision timeout is set below route resync period our gc controller will GC revisions before they are able to receive a heartbeat. Fixes: knative#4234
b5ee977 to
4ab8a18
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: greghaynes, mattmoor The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
From ROLES.md 1/ Reviewer of the codebase for at least 3 months. knative#4245 is 9 months old. 2/ Primary reviewer for at least 10 substantial PRs to the codebase. [4 XLs](https://github.com/knative/serving/pulls?q=is%3Apr++is%3Aclosed+reviewed-by%3Anak3+label%3Asize%2FXL+) [13 Ls](https://github.com/knative/serving/pulls?q=is%3Apr++is%3Aclosed+reviewed-by%3Anak3+label%3Asize%2FL) 3/ [56 Reviewed PRs](https://github.com/knative/serving/pulls?q=is%3Apr++is%3Aclosed+reviewed-by%3Anak3+) 4/ [116 Merged PRs]( https://github.com/knative/serving/pulls?q=is%3Apr+is%3Aclosed+author%3Anak3) 4/ Nominated by nghia@ with no objections from other leads
From ROLES.md 1/ Reviewer of the codebase for at least 3 months. knative#4245 is 9 months old. 2/ Primary reviewer for at least 10 substantial PRs to the codebase. [4 XLs](https://github.com/knative/serving/pulls?q=is%3Apr++is%3Aclosed+reviewed-by%3Anak3+label%3Asize%2FXL+) [13 Ls](https://github.com/knative/serving/pulls?q=is%3Apr++is%3Aclosed+reviewed-by%3Anak3+label%3Asize%2FL) 3/ [56 Reviewed PRs](https://github.com/knative/serving/pulls?q=is%3Apr++is%3Aclosed+reviewed-by%3Anak3+) 4/ [116 Merged PRs]( https://github.com/knative/serving/pulls?q=is%3Apr+is%3Aclosed+author%3Anak3) 4/ Nominated by nghia@ with no objections from other leads
* Add nak3 to networking approvers. From ROLES.md 1/ Reviewer of the codebase for at least 3 months. #4245 is 9 months old. 2/ Primary reviewer for at least 10 substantial PRs to the codebase. [4 XLs](https://github.com/knative/serving/pulls?q=is%3Apr++is%3Aclosed+reviewed-by%3Anak3+label%3Asize%2FXL+) [13 Ls](https://github.com/knative/serving/pulls?q=is%3Apr++is%3Aclosed+reviewed-by%3Anak3+label%3Asize%2FL) 3/ [56 Reviewed PRs](https://github.com/knative/serving/pulls?q=is%3Apr++is%3Aclosed+reviewed-by%3Anak3+) 4/ [116 Merged PRs]( https://github.com/knative/serving/pulls?q=is%3Apr+is%3Aclosed+author%3Anak3) 4/ Nominated by nghia@ with no objections from other leads * Sort the lines. * Sort lines alphabetically * Remove merge conflict markers.
If revision timeout is set below route resync period our gc controller
will GC revisions before they are able to receive a heartbeat.
Fixes: #4234
Release Note