Skip to content

Commit af73052

Browse files
committed
fix(csharp): re-add error resilience with finally-based delay
The previous commit accidentally removed the try-catch. Re-add error resilience using a finally block for Task.Delay per reviewer feedback, eliminating duplication and nested try-catch. Co-authored-by: Isaac
1 parent 4229f55 commit af73052

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

csharp/src/Reader/DatabricksOperationStatusPoller.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,10 @@ private async Task PollOperationStatus(CancellationToken cancellationToken)
125125
{ "poll_count", _pollCount }
126126
}));
127127
}
128-
129-
// Wait before next poll — shared by both success and error paths.
130-
// On cancellation this throws OperationCanceledException which propagates
131-
// up to the caller (Dispose catches it).
132-
await Task.Delay(TimeSpan.FromSeconds(_heartbeatIntervalSeconds), cancellationToken);
128+
finally
129+
{
130+
await Task.Delay(TimeSpan.FromSeconds(_heartbeatIntervalSeconds), cancellationToken);
131+
}
133132
}
134133

135134
// Add telemetry tags to current activity when polling completes

0 commit comments

Comments
 (0)