{"record":{"id":"71843ae3125bbb5f","repo":"influxdata/influxdb","slug":"deadline-expired-before-operation-could-complete-0","errorCode":null,"errorMessage":"Deadline expired before operation could complete: {0}","messagePattern":"Deadline expired before operation could complete: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/influxdb_iox_client/src/client/error.rs","lineNumber":75,"sourceCode":"    fn try_decode(status: &Status) -> Option<Self> {\n        generated_types::google::decode_precondition_violation(status).next()\n    }\n}\n\n/// The errors returned by this client\n#[derive(Error, Debug)]\n#[expect(missing_docs)]\npub enum Error {\n    #[error(\"The operation was cancelled: {0}\")]\n    Cancelled(ServerError<()>),\n\n    #[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}\")]","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/influxdb_iox_client/src/client/error.rs#L57-L93","documentation":"The `Error::DeadlineExceeded` variant, wrapping a `ServerError<()>`. Raised when the operation's deadline expired before the server could complete it, mirroring gRPC's DEADLINE_EXCEEDED status. Unlike cancellation, this is a timing failure, not a user-initiated cancel.","triggerScenarios":"A request with a timeout/deadline set (via tonic or the client config) did not finish before the deadline expired; long-running queries or writes against a slow or overloaded IOx server.","commonSituations":"Large queries scanning too much data, overloaded servers, too-short timeout configured in the client, network latency pushing a request past its deadline in production.","solutions":["Increase the client/request timeout/deadline to a realistic value for the operation.","Narrow the query (add time-range filters, reduce columns) so it completes faster.","Check server load and resources; scale or optimize the server side.","Retry with backoff if the deadline failure was transient; consider deadline propagation across service hops."],"exampleFix":"// before\nlet mut req = Request::new(query);\n// no timeout set / very short default\n// after\nlet mut req = Request::new(query);\nreq.set_timeout(Duration::from_secs(120));","handlingStrategy":"retry","validationCode":"// ensure a sensible deadline before sending\nreq.set_timeout(Duration::from_secs(timeout_secs.max(30)));","typeGuard":"fn is_deadline_exceeded(e: &Error) -> bool { matches!(e, Error::DeadlineExceeded(_)) }","tryCatchPattern":"match result {\n    Err(Error::DeadlineExceeded(_)) if retries < MAX => { sleep(backoff).await; retry() }\n    other => other,\n}","preventionTips":["Set explicit, operation-appropriate timeouts instead of relying on defaults.","Bound query time ranges and result sizes so operations finish predictably.","Monitor server latency and alert before deadlines become tight."],"tags":["grpc","timeout","network","influxdb"],"backgroundTag":"request-timeout","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"}