diff --git a/protocol/pubsub/v2/protocol.go b/protocol/pubsub/v2/protocol.go index 063812a8a..f8e70e2c6 100644 --- a/protocol/pubsub/v2/protocol.go +++ b/protocol/pubsub/v2/protocol.go @@ -201,7 +201,10 @@ func (t *Protocol) startSubscriber(ctx context.Context, sub subscriptionWithTopi } // Ok, ready to start pulling. return conn.Receive(ctx, func(ctx context.Context, m *pubsub.Message) { - t.incoming <- *m + select { + case t.incoming <- *m: + case <-ctx.Done(): + } }) }