pub struct TenantStoreConfig {
pub per_tenant: TaskStoreConfig,
pub max_tenants: usize,
}Expand description
Configuration for TenantAwareInMemoryTaskStore.
Fields§
§per_tenant: TaskStoreConfigStore configuration for every tenant without an override set via
TenantAwareInMemoryTaskStore::with_tenant_override.
max_tenants: usizeMaximum number of tenants allowed. Default: 1000.
§What it prevents, and what it converts the problem into
It bounds memory against tenant enumeration — that much was already
written here. What was not: a tenant id is whatever the handler’s
tenant resolution produced, and every bundled
TenantResolver reads client-controlled input
(see that module’s security section). So
a caller who can send N distinct tenant ids creates N partitions, and
once this cap is reached every new tenant is refused, including
legitimate ones. The memory bound holds; availability for new tenants
is what pays for it.
prune_empty_tenants
is the reclamation path, and it is not automatic — nothing calls it —
and it only removes partitions whose task count is zero. A
partition created by a save holds a task until that task is evicted,
so at the shipped one-hour TTL a burst of 1,000 junk tenant ids locks
out new tenants for an hour even with pruning scheduled.
The mitigation is the same precondition the resolvers state: the tenant id must come from something authenticated, not from a header a client chose. Raise this only alongside that.
Trait Implementations§
Source§impl Clone for TenantStoreConfig
impl Clone for TenantStoreConfig
Source§fn clone(&self) -> TenantStoreConfig
fn clone(&self) -> TenantStoreConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TenantStoreConfig
impl Debug for TenantStoreConfig
Auto Trait Implementations§
impl Freeze for TenantStoreConfig
impl RefUnwindSafe for TenantStoreConfig
impl Send for TenantStoreConfig
impl Sync for TenantStoreConfig
impl Unpin for TenantStoreConfig
impl UnsafeUnpin for TenantStoreConfig
impl UnwindSafe for TenantStoreConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request