Skip to content

Add Nexus tenant 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 Nexus tenant 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 TenantRateLimitInterceptor extension point for Nexus per-tenant rate limiting: the interface + a no-op default (NewNoopTenantRateLimitInterceptor), ErrTenantRateLimitExceeded (cause RESOURCE_EXHAUSTED_CAUSE_TENANT_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 tenant check is the first resource gate — it runs before namespace-concurrency, namespace-RPS, and the global RPS limiter — so one abusive tenant 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: tenant 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_TENANT_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 Nexus tenant 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 2 times, most recently from de2e428 to 8c0f574 Compare July 10, 2026 21:44
@prathyushpv
prathyushpv force-pushed the ppv/nexus-caller-rate-limit-oss branch 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
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