{"record":{"id":"3d35b14628a4cc6b","repo":"influxdata/influxdb","slug":"some-resource-has-been-exhausted-0","errorCode":null,"errorMessage":"Some resource has been exhausted: {0}","messagePattern":"Some resource has been exhausted: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"core/influxdb_iox_client/src/client/error.rs","lineNumber":87,"sourceCode":"    #[error(\"Unknown server error: {0}\")]\n    Unknown(ServerError<()>),\n\n    #[error(\"Client specified an invalid argument: {0}\")]\n    InvalidArgument(Box<ServerError<FieldViolation>>),\n\n    #[error(\"Deadline expired before operation could complete: {0}\")]\n    DeadlineExceeded(ServerError<()>),\n\n    #[error(\"{0}\")]\n    NotFound(Box<ServerError<NotFound>>),\n\n    #[error(\"Some entity that we attempted to create already exists: {0}\")]\n    AlreadyExists(Box<ServerError<AlreadyExists>>),\n\n    #[error(\"The caller does not have permission to execute the specified operation: {0}\")]\n    PermissionDenied(ServerError<()>),\n\n    #[error(\"Some resource has been exhausted: {0}\")]\n    ResourceExhausted(ServerError<()>),\n\n    #[error(\"The system is not in a state required for the operation's execution: {0}\")]\n    FailedPrecondition(Box<ServerError<PreconditionViolation>>),\n\n    #[error(\"The operation was aborted: {0}\")]\n    Aborted(ServerError<()>),\n\n    #[error(\"Operation was attempted past the valid range: {0}\")]\n    OutOfRange(ServerError<()>),\n\n    #[error(\"Operation is not implemented or supported: {0}\")]\n    Unimplemented(ServerError<()>),\n\n    #[error(\"Internal error: {0}\")]\n    Internal(ServerError<()>),\n\n    #[error(\"The service is currently unavailable: {0}\")]","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/influxdb_iox_client/src/client/error.rs#L69-L105","documentation":"The `Error::ResourceExhausted` variant, wrapping a `ServerError<()>`. Raised when some resource has been exhausted — quota, rate limit, memory, or capacity — mirroring gRPC's RESOURCE_EXHAUSTED status.","triggerScenarios":"Exceeding server-side rate limits or per-tenant quotas on writes/queries; server out of memory or disk; too many concurrent requests; message payload larger than the configured gRPC max size.","commonSituations":"Write storms from telemetry pipelines, shared cluster quota consumed by other tenants, undersized server instances, large batch writes exceeding message size limits.","solutions":["Back off and retry with exponential backoff/jitter — this is often transient.","Reduce request rate and batch size; spread writes over time.","Check and raise quotas/limits (gRPC max message size, tenant quotas) where appropriate.","Scale the server (memory/disk/instances) if exhaustion is structural."],"exampleFix":"// before\nfor batch in batches { client.write(ns, batch).await?; } // as fast as possible\n// after\nfor batch in batches {\n    loop {\n        match client.write(ns, batch.clone()).await {\n            Err(Error::ResourceExhausted(_)) => { tokio::time::sleep(backoff.next()).await; }\n            other => { other?; break; }\n        }\n    }\n}","handlingStrategy":"retry","validationCode":"// throttle client-side before hitting server limits\nif in_flight_requests() > MAX_CONCURRENCY { wait_for_slot().await; }","typeGuard":"fn is_resource_exhausted(e: &Error) -> bool { matches!(e, Error::ResourceExhausted(_)) }","tryCatchPattern":"match result {\n    Err(Error::ResourceExhausted(_)) => { backoff.sleep().await; retry_with_jitter() }\n    other => other,\n}","preventionTips":["Build backoff-with-jitter retry into every write/query path from day one.","Rate-limit and batch client-side to stay under server quotas.","Monitor quota/limit metrics and raise them before saturation."],"tags":["grpc","rate-limit","quota","influxdb"],"backgroundTag":"rate-limit-exceeded","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}