{"record":{"id":"7b56c7c1f4a5a4a0","repo":"t8y2/dbx","slug":"tdengine-operation-timed-out-after-timeout-secs","errorCode":null,"errorMessage":"TDengine operation timed out after {timeout_secs} seconds","messagePattern":"TDengine operation timed out after (.+?) seconds","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/tdengine/src/driver.rs","lineNumber":806,"sourceCode":"    query_timezone.or(block_timezone).or(session_timezone)\n}\n\nfn parse_server_timezone(value: &str) -> Option<Tz> {\n    value.split_whitespace().next()?.parse().ok()\n}\n\nasync fn cancellable<T, F>(token: &CancellationToken, timeout_secs: u64, future: F) -> Result<T>\nwhere\n    F: Future<Output = taos::RawResult<T>>,\n{\n    tokio::pin!(future);\n    let operation = async {\n        if timeout_secs == 0 {\n            future.await.map_err(anyhow::Error::from)\n        } else {\n            timeout(Duration::from_secs(timeout_secs), future)\n                .await\n                .map_err(|_| anyhow!(\"TDengine operation timed out after {timeout_secs} seconds\"))?\n                .map_err(anyhow::Error::from)\n        }\n    };\n    tokio::select! {\n        _ = token.cancelled() => bail!(\"TDengine operation was cancelled\"),\n        result = operation => result,\n    }\n}\n\nfn effective_database<'a>(requested: &'a str, current: &'a str) -> Result<&'a str> {\n    let requested = requested.trim();\n    if !requested.is_empty() {\n        return validate_database_name(requested);\n    }\n    let current = current.trim();\n    if current.is_empty() {\n        bail!(\"TDengine database is required\");\n    }","sourceCodeStart":788,"sourceCodeEnd":824,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/tdengine/src/driver.rs#L788-L824","documentation":"Bailed by cancellable (TDengine driver) when a TDengine operation (query, fetch, execute, cursor step) exceeded its timeout_secs budget (or hit the cancellation token). The in-flight connector future is abandoned and the error carries the per-operation timeout that fired; session-level operations wrap their own contexts around this helper.","triggerScenarios":"Thrown at agents/drivers/tdengine/src/driver.rs:806 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase the per-request timeout_secs parameter for the operation","Optimize or limit the query (WHERE clauses, LIMIT) so it completes faster","Check server load and taosAdapter latency","For cancellation-token hits, verify the client did not cancel the operation prematurely"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}