You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "birschick-bq (via GitHub)" <gi...@apache.org> on 2025/08/18 20:39:46 UTC
[PR] fix(csharp/src/Drivers/Apache/Hive2): add check to see if operation is already closed. [arrow-adbc]
birschick-bq opened a new pull request, #3301:
URL: https://github.com/apache/arrow-adbc/pull/3301
Add check to see if operation is already closed because it's a direct result.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(csharp/src/Drivers/Apache/Hive2): add check to see if operation is already closed [arrow-adbc]
Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher merged PR #3301:
URL: https://github.com/apache/arrow-adbc/pull/3301
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(csharp/src/Drivers/Apache/Hive2): add check to see if operation is already closed [arrow-adbc]
Posted by "birschick-bq (via GitHub)" <gi...@apache.org>.
birschick-bq commented on PR #3301:
URL: https://github.com/apache/arrow-adbc/pull/3301#issuecomment-3201404156
@CurtHagenlocher - 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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(csharp/src/Drivers/Apache/Hive2): add check to see if operation is already closed [arrow-adbc]
Posted by "birschick-bq (via GitHub)" <gi...@apache.org>.
birschick-bq commented on code in PR #3301:
URL: https://github.com/apache/arrow-adbc/pull/3301#discussion_r2283532525
##########
csharp/src/Drivers/Apache/Hive2/HiveServer2Reader.cs:
##########
@@ -429,13 +429,17 @@ protected override void Dispose(bool disposing)
/// <param name="response">The response for the operation.</param>
/// <returns>The server response for the CloseOperation call.</returns>
/// <exception cref="HiveServer2Exception" />
- internal static async Task<TCloseOperationResp> CloseOperationAsync(IHiveServer2Statement statement, IResponse response)
+ internal static async Task<TCloseOperationResp?> CloseOperationAsync(IHiveServer2Statement statement, IResponse response)
{
- CancellationToken cancellationToken = ApacheUtility.GetCancellationToken(statement.QueryTimeoutSeconds, ApacheUtility.TimeUnit.Seconds);
- TCloseOperationReq request = new TCloseOperationReq(response.OperationHandle!);
- TCloseOperationResp resp = await statement.Client.CloseOperation(request, cancellationToken);
- HiveServer2Connection.HandleThriftResponse(resp.Status, activity: null);
- return resp;
+ if (response.DirectResults?.CloseOperation?.Status?.StatusCode != TStatusCode.SUCCESS_STATUS)
+ {
+ CancellationToken cancellationToken = ApacheUtility.GetCancellationToken(statement.QueryTimeoutSeconds, ApacheUtility.TimeUnit.Seconds);
+ TCloseOperationReq request = new TCloseOperationReq(response.OperationHandle!);
+ TCloseOperationResp resp = await statement.Client.CloseOperation(request, cancellationToken);
+ HiveServer2Connection.HandleThriftResponse(resp.Status, activity: null);
+ return resp;
+ }
+ return null;
Review Comment:
No. `CloseOperationAsync` returns a non-null `Task<TCloseOperationResp?>`. So it is safe to call `ConfigureAwait(false).GetAwaiter().GetResult()`. The `GetResult()` may return the `null`.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(csharp/src/Drivers/Apache/Hive2): add check to see if operation is already closed [arrow-adbc]
Posted by "birschick-bq (via GitHub)" <gi...@apache.org>.
birschick-bq commented on PR #3301:
URL: https://github.com/apache/arrow-adbc/pull/3301#issuecomment-3201343859
@CurtHagenlocher - Hoping to get a quick turnaround on this fix. Currently, without this fix, all Thrift-based driver are throwing an unwanted exception on Dispose for the `QueryResult` stream.
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(csharp/src/Drivers/Apache/Hive2): add check to see if operation is already closed [arrow-adbc]
Posted by "eric-wang-1990 (via GitHub)" <gi...@apache.org>.
eric-wang-1990 commented on code in PR #3301:
URL: https://github.com/apache/arrow-adbc/pull/3301#discussion_r2283516068
##########
csharp/src/Drivers/Apache/Hive2/HiveServer2Reader.cs:
##########
@@ -429,13 +429,17 @@ protected override void Dispose(bool disposing)
/// <param name="response">The response for the operation.</param>
/// <returns>The server response for the CloseOperation call.</returns>
/// <exception cref="HiveServer2Exception" />
- internal static async Task<TCloseOperationResp> CloseOperationAsync(IHiveServer2Statement statement, IResponse response)
+ internal static async Task<TCloseOperationResp?> CloseOperationAsync(IHiveServer2Statement statement, IResponse response)
{
- CancellationToken cancellationToken = ApacheUtility.GetCancellationToken(statement.QueryTimeoutSeconds, ApacheUtility.TimeUnit.Seconds);
- TCloseOperationReq request = new TCloseOperationReq(response.OperationHandle!);
- TCloseOperationResp resp = await statement.Client.CloseOperation(request, cancellationToken);
- HiveServer2Connection.HandleThriftResponse(resp.Status, activity: null);
- return resp;
+ if (response.DirectResults?.CloseOperation?.Status?.StatusCode != TStatusCode.SUCCESS_STATUS)
+ {
+ CancellationToken cancellationToken = ApacheUtility.GetCancellationToken(statement.QueryTimeoutSeconds, ApacheUtility.TimeUnit.Seconds);
+ TCloseOperationReq request = new TCloseOperationReq(response.OperationHandle!);
+ TCloseOperationResp resp = await statement.Client.CloseOperation(request, cancellationToken);
+ HiveServer2Connection.HandleThriftResponse(resp.Status, activity: null);
+ return resp;
+ }
+ return null;
Review Comment:
Would this cause NPE here? https://github.com/apache/arrow-adbc/blob/8dd3d0b90c2802ca3cc800cc6525493297484c3d/csharp/src/Drivers/Apache/Hive2/HiveServer2Reader.cs#L413
--
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-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org