Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Log details about reservation that remain unbound for too long (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis-D authored Apr 13, 2023
1 parent c89cd60 commit b39c14f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/extender/resourcereservations.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ import (
clientcache "k8s.io/client-go/tools/cache"
)

const (
slowLogDuration = 2 * time.Minute
)

var podGroupVersionKind = v1.SchemeGroupVersion.WithKind("Pod")

// ResourceReservationManager is a central point which manages the creation and reading of both resource reservations and soft reservations
Expand Down Expand Up @@ -367,6 +371,18 @@ func (rrm *defaultResourceReservationManager) bindExecutorToResourceReservation(
if !creationTime.IsZero() {
duration := time.Since(creationTime)
metrics.ReportTimeToFirstBindMetrics(ctx, duration)

if duration > slowLogDuration {
svc1log.FromContext(ctx).Warn(
"Time to first executor bind to resource reservation is above threshold",
svc1log.SafeParam("duration", duration.String()),
svc1log.SafeParam("appID", resourceReservation.Labels[v1beta1.AppIDLabel]),
svc1log.SafeParam("node", node),
svc1log.SafeParam("executor", executor.Name),
svc1log.SafeParam("executorNamespace", executor.Namespace),
svc1log.SafeParam("reservationName", reservationName),
)
}
}
}
return nil
Expand Down

0 comments on commit b39c14f

Please sign in to comment.