@@ -313,7 +313,7 @@ func (cache *snapshotCache) BatchUpsertResources(ctx context.Context, typ string
313313 info .mu .Lock ()
314314
315315 // Respond to delta watches for the node.
316- err := cache .respondDeltaWatches (ctx , info , snapshot )
316+ err := cache .respondDeltaWatches (ctx , info , s )
317317 if err != nil {
318318 info .mu .Unlock ()
319319 continue
@@ -904,7 +904,7 @@ func createResponse(ctx context.Context, request *Request, resources map[string]
904904}
905905
906906// CreateDeltaWatch returns a watch for a delta xDS request which implements the Simple SnapshotCache.
907- func (cache * snapshotCache ) CreateDeltaWatch (request * DeltaRequest , state stream.StreamState , value chan DeltaResponse ) func () {
907+ func (cache * snapshotCache ) CreateDeltaWatch (request * DeltaRequest , state stream.StreamState , value chan DeltaResponse ) ( bool , func () ) {
908908 nodeID := cache .hash .ID (request .GetNode ())
909909 t := request .GetTypeUrl ()
910910
@@ -934,12 +934,12 @@ func (cache *snapshotCache) CreateDeltaWatch(request *DeltaRequest, state stream
934934 cache .log .Errorf ("failed to compute version for snapshot resources inline: %s" , err )
935935 }
936936 // We don't need to respond. We're handling this in a better way in ads.
937- // response, err := cache.respondDelta(context.Background(), snapshot, request, value, state)
937+ response , err := cache .respondDelta (context .Background (), snapshot , request , value , state )
938938 if err != nil {
939939 cache .log .Errorf ("failed to respond with delta response: %s" , err )
940940 }
941941
942- delayedResponse = true // response == nil
942+ delayedResponse = response == nil
943943 }
944944
945945 if delayedResponse {
@@ -952,10 +952,10 @@ func (cache *snapshotCache) CreateDeltaWatch(request *DeltaRequest, state stream
952952 }
953953
954954 info .setDeltaResponseWatch (watchID , DeltaResponseWatch {Request : request , Response : value , StreamState : state })
955- return cache .cancelDeltaWatch (nodeID , watchID )
955+ return delayedResponse , cache .cancelDeltaWatch (nodeID , watchID )
956956 }
957957
958- return nil
958+ return false , nil
959959}
960960
961961func GetEnvoyNodeStr (node * core.Node ) string {
0 commit comments