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

[release-1.2] Fixes an activator panic when the throttle encounters a cache.DeleteFinalStateUnknown #12680

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pkg/activator/net/throttler.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
pkgnet "knative.dev/networking/pkg/apis/networking"
endpointsinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/endpoints"
"knative.dev/pkg/controller"
"knative.dev/pkg/kmeta"
"knative.dev/pkg/logging"
"knative.dev/pkg/logging/logkey"
"knative.dev/pkg/reconciler"
Expand Down Expand Up @@ -570,8 +571,13 @@ func (t *Throttler) revisionUpdated(obj interface{}) {
// revisionDeleted is to clean up revision throttlers after a revision is deleted to prevent unbounded
// memory growth
func (t *Throttler) revisionDeleted(obj interface{}) {
rev := obj.(*v1.Revision)
revID := types.NamespacedName{Namespace: rev.Namespace, Name: rev.Name}
acc, err := kmeta.DeletionHandlingAccessor(obj)
if err != nil {
t.logger.Warnw("Revision delete failure to process", zap.Error(err))
return
}

revID := types.NamespacedName{Namespace: acc.GetNamespace(), Name: acc.GetName()}

t.logger.Debugw("Revision delete", zap.String(logkey.Key, revID.String()))

Expand Down