dapr / components-contrib

Community driven, reusable components for distributed apps
Apache License 2.0
548 stars 479 forks source link

GCP PubSub resulting in excessive "Administrator operations per minute" on publish #2539

Closed CafeLungo closed 11 months ago

CafeLungo commented 1 year ago

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 using disableEntityManagement: False on our pubsub.gcp.pubsub Component.

Expected Behavior

Actual Behavior

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.

CafeLungo commented 1 year 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)."}"
yaron2 commented 1 year ago

You are correct, this needs improving. Triaging for 1.11.

berndverst commented 1 year ago

No activity here. Moving to 1.12

artursouza commented 1 year ago

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.

sadath-12 commented 11 months ago

/assign