Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/spec-v0.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ impl Statement {
/// Read-only access (for logging or assertion).
pub fn spec_ref(&self) -> &StatementSpec;

/// Wait-for-result execution with the existing 600s polling ceiling.
/// Wait-for-result execution without an overall client polling deadline.
pub async fn execute(&mut self) -> Result<ExecutedStatement>;

/// Execute with a client deadline through terminal-state mapping.
Expand Down
4 changes: 2 additions & 2 deletions include/databricks_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,8 @@ KernelStatusCode kernel_statement_set_query_tags(kernel_statement_t* stmt,
const char* query_tags);

/*
* Wait-for-result execution with the existing 600-second polling ceiling and
* no caller-supplied deadline. On success, release `*out` with
* Wait-for-result execution without an overall client polling deadline.
* On success, release `*out` with
* `kernel_executed_statement_close`.
*/
KernelStatusCode kernel_statement_execute(kernel_statement_t* stmt,
Expand Down
4 changes: 2 additions & 2 deletions pyo3/src/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ impl Statement {
/// `ExecutedAsyncStatement` the caller drives via `status()` /
/// `await_result()` / `fetch_result()`.
///
/// Long-running queries that would blow past `execute()`'s sync
/// polling budget belong on this path.
/// Use this path when the caller needs a poll/cancel handle instead of
/// waiting synchronously for a terminal state.
fn submit(&mut self, py: Python<'_>) -> PyResult<ExecutedAsyncStatement> {
let inner = alive_mut!(self, "Statement");
let runtime = inner.runtime.clone();
Expand Down
2 changes: 1 addition & 1 deletion src/c_abi/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ pub unsafe extern "C" fn kernel_statement_execute(
return store_invalid_arg("kernel_statement_execute: out must not be null");
}

execute_with_timeout_mode(stmt, ExecutionTimeout::Default, out)
execute_with_timeout_mode(stmt, ExecutionTimeout::Unlimited, out)
}

/// Wait-for-result execution with a client deadline in milliseconds.
Expand Down
6 changes: 3 additions & 3 deletions src/client/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ use std::time::{Duration, Instant};

// ─── Transport-shared config ────────────────────────────────────────

/// Timeout policy for synchronous execution.
/// Timeout policy for statement execution.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) enum ExecutionTimeout {
/// Preserve the transport's pre-existing polling ceiling.
Default,
/// The caller explicitly disabled the client timeout.
/// Skip the transport's polling ceiling.
Unlimited,
/// Apply one absolute client deadline.
Deadline(Instant),
Expand All @@ -60,7 +60,7 @@ impl ExecutionTimeout {
/// never reads it.
#[derive(Debug, Clone)]
pub(crate) struct TransportConfig {
/// Default polling ceiling for sync, async, and metadata execution (600s).
/// Default polling ceiling for async and metadata execution (600s).
pub poll_timeout: Duration,
/// Interval between status polls (default: 500ms).
pub poll_interval: Duration,
Expand Down
10 changes: 4 additions & 6 deletions src/statement/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,9 @@ impl Statement {
/// statement on success and returns `state=CLOSED`. Setting
/// `wait_timeout=10s` explicitly returns `state=SUCCEEDED`
/// (statement still alive server-side, requires a separate
/// `CloseStatement`) and adds ~150–260ms to the response —
/// observed against Dogfood; see PR description for the bench
/// numbers. The kernel polls internally if the query needs
/// longer than 10s. This entry point retains the transport's 600s polling
/// ceiling; use [`Statement::execute_with_timeout`] to choose another limit.
/// `CloseStatement`). The kernel polls internally if the query needs
/// longer than 10s. This entry point has no overall client polling deadline;
/// use [`Statement::execute_with_timeout`] to set one.
///
/// If a prior executed handle is still tracked by this `Statement`,
/// the kernel spawns a fire-and-forget `CloseStatement` against it
Expand All @@ -317,7 +315,7 @@ impl Statement {
/// calls on it short-circuit to `InvalidStatementHandle` without
/// hitting the wire.
pub async fn execute(&mut self) -> Result<ExecutedStatement> {
self.execute_with_timeout_mode(ExecutionTimeout::Default)
self.execute_with_timeout_mode(ExecutionTimeout::Unlimited)
.await
}

Expand Down
Loading