Repository navigation
fix(telemetry): keep async polling retries non-terminal - #290
jay-xiao446 wants to merge 1 commit into
Conversation
Signed-off-by: Jay Xiao <jay.xiao@databricks.com>
There was a problem hiding this comment.
Verdict: 1 Low
Looks good — the change correctly keeps telemetry open and defuses the drop-cancel guard on retryable status-poll RPC errors, is well-scoped, and has a solid wiremock regression. finalize idempotency and the Error.retryable gating check out. One low-severity note: the Drop fallback now reports success (finalize(None)) for a statement abandoned after only transient poll errors, where it previously reported the error.
| .instrument(span) | ||
| .await; | ||
| if let Err(error) = &result { | ||
| if !Self::should_finalize_poll_error(error) { |
There was a problem hiding this comment.
🔵 Low — Leaving telemetry open on a retryable poll error changes the telemetry outcome for an abandoned statement from error to success.
Before this PR, a caller that polled status() (or await_result()), received a retryable RPC error, and then gave up (dropped the handle without a successful retry) produced a terminal telemetry event carrying that error (finalize(Some(error))). After this change, the retryable branch returns early without finalizing, so the only finalize that runs is Drop's fallback self.statement_telemetry.finalize(None) — which emits a success event for a statement that never completed for this client.
This is consistent with the existing "submit-and-drop emits success" convention in Drop, so it may be acceptable, but it does mean a statement abandoned mid-poll due to transient failures is now reported as a successful async statement operation. Worth confirming that's the intended telemetry semantics — if not, the abandoned-after-retryable case would need to distinguish "never reached terminal" from "succeeded" at drop time.
Summary
status()returns a retryable polling RPC error so a later successful poll/fetch can emit the terminal success event.await_result()'s drop-cancel guard when returning a retryable status poll RPC error, preserving the server query for caller retry.Test Plan
cargo test async_statement_retryable_status_error_then_success_exports_one_success_event --lib --lockedcargo test async_statement_ --lib --lockedcargo test telemetry --lib --lockedcargo clippy --all-targets --locked -- -D warnings