Skip to content

Support publish hedging in pubsub::client::Publisher #6776

Description

@suzmue

Support publish request hedging in google-cloud-pubsub to reduce p99/p99.9 tail latency caused by transient network stalls or slow backend tasks.

Design

  • Hedging Mechanism: When an in-flight batch publish exceeds a configured delay threshold, send a concurrent duplicate publish RPC and resolve the batch with whichever attempt finishes first.
  • Rate Limiting: Rate-limit hedged RPCs using a token bucket that refills on successful publish RPCs.
  • Telemetry: Attach the x-goog-pubsub-client-telemetry header to hedged attempts for backend tracking.
  • Ordering Safety: Hedging does not apply for messages with ordering keys.

See java reference implementation: https://github.com/googleapis/google-cloud-java/pull/13735/changes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the Pub/Sub API.priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions