Skip to content

Commit b05d562

Browse files
fixup! fix(volume): preserve Python errors and transfer telemetry
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
1 parent 8caaaf5 commit b05d562

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

‎KERNEL_REV‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9ed6b728dc609f0c96ab09f21cf90a27dd932553
1+
c2ddddc61bd41d9529dd19f36546d603ba21150d

‎src/databricks/sql/backend/kernel/client.py‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
Optional,
3434
Set,
3535
TYPE_CHECKING,
36-
Tuple,
3736
Union,
3837
)
3938

@@ -392,8 +391,8 @@ def __init__(
392391
# Guarded by its own lock — cancel can race execute teardown.
393392
self._sync_cancellers: Dict[int, Any] = {}
394393
self._sync_cancellers_lock = threading.RLock()
395-
# Retain the mutable owner until its transfer completes; dropping it cancels the result.
396-
self._volume_handles: Dict[str, Tuple[Any, Any]] = {}
394+
# Volume transfers remain cancellable after synchronous SQL execution returns.
395+
self._volume_handles: Dict[str, Any] = {}
397396

398397
# ── Session lifecycle ──────────────────────────────────────────
399398

@@ -639,8 +638,7 @@ def execute_command(
639638
if executed.is_volume_operation:
640639
with self._sync_cancellers_lock:
641640
self._volume_handles[command_id.guid] = (
642-
stmt,
643-
self._sync_cancellers.get(id(cursor)),
641+
self._sync_cancellers.get(id(cursor))
644642
)
645643
# Execute succeeded: the kernel now owns the statement
646644
# lifecycle. It auto-closes the server statement when the
@@ -722,8 +720,7 @@ def finish_volume_operation(self, command_id: CommandId) -> None:
722720

723721
def cancel_command(self, command_id: CommandId) -> None:
724722
with self._sync_cancellers_lock:
725-
volume = self._volume_handles.get(command_id.guid)
726-
handle = volume[1] if volume is not None else None
723+
handle = self._volume_handles.get(command_id.guid)
727724
if handle is None:
728725
with self._async_handles_lock:
729726
handle = self._async_handles.get(command_id.guid)

0 commit comments

Comments
 (0)