Closed CafeLungo closed 11 months ago
Known workaround: Setup a separate pubsub.gcp.pubsub
Component with disableEntityManagement: True
and use that for publishing. That eliminates the call to ensureTopic()
. And it still returns a failure if the topic doesn't exist.
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.INTERNAL
details = "error when publish to topic test-publish-missing-topic in pubsub stage-gcp-pubsub-publisher: rpc error: code = NotFound desc = Resource not found (resource=test-publish-missing-topic)."
debug_error_string = "UNKNOWN:Error received from peer ipv4:127.0.0.1:50001 {created_time:"2023-02-16T16:02:25.683510586+00:00", grpc_status:13, grpc_message:"error when publish to topic test-publish-missing-topic in pubsub stage-gcp-pubsub-publisher: rpc error: code = NotFound desc = Resource not found (resource=test-publish-missing-topic)."}"
You are correct, this needs improving. Triaging for 1.11.
No activity here. Moving to 1.12
I propose the fix to have a local cache of all topics that went through "ensureTopic()" call and skip those going forward. It will reduce a lot since each instance will only "ensureTopic()" once per topic used.
/assign
Our team is running into a problem when we start load testing Dapr using GCP PubSub to publish message. There is an admin action, which we believe is part of the
ensureTopic
call on every single publish when we are usingdisableEntityManagement: False
on ourpubsub.gcp.pubsub
Component.Expected Behavior
getTopic
should not be excessive.Actual Behavior
getTopic
is called multiple times in the process of publishing a message: https://github.com/dapr/components-contrib/blob/master/pubsub/gcp/pubsub/pubsub.go#L233-L261ensureTopic()
ensureTopic
may be too aggressive to check that the topic exists on every single publish.Topic
reference, thePublishResult
should have an error if the topic doesn't exist.Steps to Reproduce the Problem
Note: Our team was attempting to simulate traffic that we will experience in production.
Release Note
RELEASE NOTE: FIX Reduced number of administrator calls on publish to a GCP PubSub Topic.