Skip to content

Commit 598a760

Browse files
committed
grpc transport v2
Signed-off-by: Wei Liu <[email protected]>
1 parent a41bfeb commit 598a760

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

pkg/cloudevents/generic/options/v2/grpc/transport.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,6 @@ func (t *grpcTransport) monitorConnectionState(ctx context.Context, conn *grpc.C
214214
if !conn.WaitForStateChange(ctx, state) {
215215
// the ctx is closed, stop this watch
216216
logger.Info("stop watching grpc connection state")
217-
if err := conn.Close(); err != nil {
218-
logger.Error(err, "failed to close grpc connection")
219-
}
220217
return
221218
}
222219

pkg/cloudevents/server/grpc/broker.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ func (bkr *GRPCBroker) handleRes(
368368
evt *cloudevents.Event,
369369
t types.CloudEventsDataType,
370370
action types.EventAction) error {
371-
log := klog.FromContext(ctx)
372371

373372
bkr.mu.RLock()
374373
defer bkr.mu.RUnlock()
@@ -386,16 +385,14 @@ func (bkr *GRPCBroker) handleRes(
386385
}
387386
clusterName := fmt.Sprintf("%s", clusterNameValue)
388387

389-
for id, subscriber := range bkr.subscribers {
388+
for subID, subscriber := range bkr.subscribers {
390389
// checks if the event should be processed by the current instance
391390
// by verifying the resource consumer name is in the subscriber list, ensuring the
392391
// event will be only processed when the consumer is subscribed to the current broker.
393392
if subscriber.clusterName == clusterName && subscriber.dataType == t {
394-
if err := subscriber.handler(ctx, id, evt); err != nil {
393+
if err := subscriber.handler(ctx, subID, evt); err != nil {
395394
return err
396395
}
397-
} else {
398-
log.V(4).Info("skip the event since the agent is not subscribed.", "subID", id, "eventContext", evt.Context)
399396
}
400397
}
401398
return nil

0 commit comments

Comments
 (0)