birschick-bq commented on code in PR #3302: URL: https://github.com/apache/arrow-adbc/pull/3302#discussion_r2291836711
########## csharp/src/Drivers/Apache/Hive2/HiveServer2Statement.cs: ########## @@ -1006,5 +1028,72 @@ public bool TryGetDirectResults(IResponse response, out TSparkDirectResults? dir directResults = null; return false; } + + /// <inheritdoc/> + public override void Cancel() + { + this.TraceActivity(_ => + { + // This will cancel any operation using the current token source + CancelTokenSource(); + }); + } + + private async Task CancelOperationAsync(Activity? activity, TOperationHandle? operationHandle) + { + if (operationHandle == null) + { + return; + } + using CancellationTokenSource cancellationTokenSource = ApacheUtility.GetCancellationTokenSource(QueryTimeoutSeconds, ApacheUtility.TimeUnit.Seconds); Review Comment: @eric-wang-1990 My thoughts here are that the default cancellation token doesn't have a timeout - so it _may_ run for a long time (unlikely unless the server is stressed). So in this case where the cancellation is caused when the `QueryTimeout` time has passed, the call to `Client.CancelOperation` may add, at most, another `QueryTimeout` amount of time before returning to the caller. To clarify, the `Client.CancelOperation` call will be made in two case: 1. The QueryTimeout has expired to cancel the token. 2. The call the Statement.Cancel cancelled the token. I think calling `Client.CancelOperation` in both cases is the correct action. Let me know if you agree or if you still think I should remove new cancellation token. Thanks. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org