Skip to content

Commit b30c90d

Browse files
committed
Adding a comment
1 parent 225f6b1 commit b30c90d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pkg/ext-proc/backend/inferencepool_reconciler.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ func (c *InferencePoolReconciler) updateDatastore(ctx context.Context, newPool *
6262
c.Datastore.PoolSet(newPool)
6363
if err != nil || !reflect.DeepEqual(newPool.Spec.Selector, oldPool.Spec.Selector) {
6464
logger.V(logutil.DEFAULT).Info("Updating inference pool endpoints", "selector", newPool.Spec.Selector)
65+
// A full resync is required to address two cases:
66+
// 1) At startup, the pod events may get processed before the pool is synced with the datastore,
67+
// and hence they will not be added to the store since pool selector is not known yet
68+
// 2) If the selector on the pool was updated, then we will not get any pod events, and so we need
69+
// to resync the whole pool: remove pods in the store that don't match the new selector and add
70+
// the ones that may have existed already to the store.
6571
c.Datastore.PodResyncAll(ctx, c.Client)
6672
}
6773
}

test/integration/hermetic_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ func setUpHermeticServer(podMetrics []*backend.PodMetrics) (client extProcPb.Ext
380380
IP(pm.Address).
381381
Obj()
382382
serverRunner.Datastore.PodUpdateOrAddIfNotExist(&pod)
383-
serverRunner.Datastore.PodUpdateMetricsIfExist(pm)
383+
serverRunner.Datastore.PodUpdateMetricsIfExist(pm.NamespacedName, &pm.Metrics)
384384
}
385385
serverRunner.Provider = backend.NewProvider(pmc, serverRunner.Datastore)
386386
if err := serverRunner.AsRunnable(logger.WithName("ext-proc")).Start(serverCtx); err != nil {

0 commit comments

Comments
 (0)