Skip to content

Add caller rate-limit interceptor interface with no-op default#11012

Draft
prathyushpv wants to merge 1 commit into
mainfrom
ppv/nexus-caller-rate-limit-oss
Draft

Add caller rate-limit interceptor interface with no-op default#11012
prathyushpv wants to merge 1 commit into
mainfrom
ppv/nexus-caller-rate-limit-oss

Conversation

@prathyushpv

@prathyushpv prathyushpv commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What changed?

Adds an OSS CallerRateLimitInterceptor extension point for per-caller rate limiting: the interface + a no-op default (NewNoopCallerRateLimitInterceptor), ErrCallerRateLimitExceeded (cause RESOURCE_EXHAUSTED_CAUSE_CALLER_RPS_LIMIT, scope NAMESPACE), an fx provider of the no-op, and a call site in the Nexus request path. Cloud injects the enforcing implementation via fx.Decorate.

The caller check is the first resource gate — it runs before namespace-concurrency, namespace-RPS, and the global RPS limiter — so one abusive caller can't consume the shared namespace/global budget before being throttled.

Why?

OSS ships the schema/plumbing; enforcement is Cloud-only. The no-op default means zero behavior change for OSS.

How did you test it?

  • built
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s) (interceptor precedence: caller wins over concurrency/namespace/global; no-op proceeds)

Potential risks

No-op default → no behavior change in OSS. [NOT READY]: references enumspb.RESOURCE_EXHAUSTED_CAUSE_CALLER_RPS_LIMIT, which requires the go.temporal.io/api release (temporalio/api#827) + a go.mod bump before this compiles in CI. Part of the caller rate-limit feature.

@prathyushpv
prathyushpv force-pushed the ppv/nexus-caller-rate-limit-oss branch from e4b7670 to 8c0f574 Compare July 10, 2026 20:59
@prathyushpv prathyushpv changed the title [NOT READY] Add Nexus caller rate-limit interceptor interface with no-op default [NOT READY] Add Nexus tenant rate-limit interceptor interface with no-op default Jul 10, 2026
@prathyushpv
prathyushpv force-pushed the ppv/nexus-caller-rate-limit-oss branch 3 times, most recently from 8c0f574 to 6225636 Compare July 10, 2026 22:05
@prathyushpv
prathyushpv requested a review from S15 July 14, 2026 17:19
@prathyushpv prathyushpv changed the title [NOT READY] Add Nexus tenant rate-limit interceptor interface with no-op default Add Nexus tenant rate-limit interceptor interface with no-op default Jul 14, 2026
@prathyushpv prathyushpv changed the title Add Nexus tenant rate-limit interceptor interface with no-op default Add tenant rate-limit interceptor interface with no-op default Jul 20, 2026
@prathyushpv
prathyushpv force-pushed the ppv/nexus-caller-rate-limit-oss branch from 6225636 to ee7711a Compare July 20, 2026 21:55
@prathyushpv prathyushpv changed the title Add tenant rate-limit interceptor interface with no-op default Add caller rate-limit interceptor interface with no-op default Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant