Skip to content
Open
Show file tree
Hide file tree
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
20 changes: 11 additions & 9 deletions clusterloader2/pkg/measurement/common/service_creation_latency.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func (s *serviceCreationLatencyMeasurement) handleIngressObject(oldObj, newObj i
return
}
newIngress, ok = newObj.(*networkingv1.Ingress)
if newIngress != nil && !ok {
if newObj != nil && !ok {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just fixes mistaken code I noticed, we should compare newObj, not newIngress (look how we do the same above this for services)

klog.Errorf("%s: uncastable new object: %v", s, newObj)
return
}
Expand Down Expand Up @@ -369,11 +369,12 @@ func (s *serviceCreationLatencyMeasurement) deleteObject(svc *corev1.Service) er
}
s.lock.Lock()
defer s.lock.Unlock()
if svc.ObjectMeta.DeletionTimestamp == nil {
klog.Warningf("DeletionTimestamp is nil for service: %v", key)
return nil
if svc.ObjectMeta.DeletionTimestamp != nil {
s.creationTimes.Set(key, phaseName(deletingPhase, svc.Spec.Type), svc.ObjectMeta.DeletionTimestamp.Time)
} else {
// Object was deleted without DeletionTimestamp (immediate deletion)
s.creationTimes.Set(key, phaseName(deletingPhase, svc.Spec.Type), time.Now())
}
s.creationTimes.Set(key, phaseName(deletingPhase, svc.Spec.Type), svc.ObjectMeta.DeletionTimestamp.Time)
s.creationTimes.Set(key, phaseName(deletedPhase, svc.Spec.Type), time.Now())
s.pingCheckers.DeleteAndStop(key)
return nil
Expand All @@ -386,11 +387,12 @@ func (s *serviceCreationLatencyMeasurement) deleteIngressObject(ingress *network
}
s.lock.Lock()
defer s.lock.Unlock()
if ingress.ObjectMeta.DeletionTimestamp == nil {
klog.Warningf("DeletionTimestamp is nil for service: %v", key)
return nil
if ingress.ObjectMeta.DeletionTimestamp != nil {
s.creationTimes.Set(key, phaseName(deletingPhase, ingressType), ingress.ObjectMeta.DeletionTimestamp.Time)
} else {
// Object was deleted without DeletionTimestamp (immediate deletion)
s.creationTimes.Set(key, phaseName(deletingPhase, ingressType), time.Now())
}
s.creationTimes.Set(key, phaseName(deletingPhase, ingressType), ingress.ObjectMeta.DeletionTimestamp.Time)
s.creationTimes.Set(key, phaseName(deletedPhase, ingressType), time.Now())
s.pingCheckers.DeleteAndStop(key)
return nil
Expand Down
4 changes: 4 additions & 0 deletions clusterloader2/testing/neg/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ steps:
Method: WaitForControlledPodsRunning
Params:
action: gather
- module:
path: /modules/ingress-measurements.yaml
params:
action: waitForDeletion
- name: Wait after deletion
measurements:
- Identifier: Wait
Expand Down