Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(csharp/src/Drivers/Apache): add connect and query timeout options #2312

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

birschick-bq
Copy link
Contributor

@birschick-bq birschick-bq commented Nov 8, 2024

Adds options for command and query timeout

Property Description Default
adbc.spark.connect_timeout_ms Sets the timeout (in milliseconds) to open a new session. Values can be 0 (infinite) or greater than zero. 30000
adbc.apache.statement.query_timeout_s Sets the maximum time (in seconds) for a query to complete. Values can be 0 (infinite) or greater than zero. 60

@github-actions github-actions bot added this to the ADBC Libraries 16 milestone Nov 11, 2024
@birschick-bq birschick-bq marked this pull request as draft November 15, 2024 16:37
Copy link
Contributor Author

@birschick-bq birschick-bq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. One small nit (that I should have done already).

csharp/src/Drivers/Apache/Hive2/HiveServer2Statement.cs Outdated Show resolved Hide resolved
csharp/src/Drivers/Apache/Spark/SparkStatement.cs Outdated Show resolved Hide resolved
@birschick-bq birschick-bq changed the title feat(csharp/src/Drivers/Apache): add connect and query timeout options - unimplemented feat(csharp/src/Drivers/Apache): add connect and query timeout options Nov 20, 2024
@birschick-bq birschick-bq marked this pull request as ready for review November 21, 2024 00:31
@birschick-bq birschick-bq marked this pull request as draft November 25, 2024 20:03
@birschick-bq birschick-bq marked this pull request as ready for review November 26, 2024 06:01
@@ -6,6 +6,7 @@

<ItemGroup>
<PackageReference Include="ApacheThrift" Version="0.21.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this reference as the ApacheThrift references version 4.3.0 which is marked as vulnerable.

@birschick-bq
Copy link
Contributor Author

Note: because we can't pass the same cancellation token to ExecuteQueryAsync and the ReadNextBatchAsync, the runtime may exceed the query timeout

@birschick-bq
Copy link
Contributor Author

Added issue and submitted PR to ensure rethrown exceptions include the original exception.
https://issues.apache.org/jira/browse/THRIFT-5838
apache/thrift#3069

@birschick-bq birschick-bq marked this pull request as draft November 26, 2024 18:43
@birschick-bq
Copy link
Contributor Author

Converted to draft because I'm trying to resolve failing tests

@davidhcoe
Copy link
Contributor

Adds options for command and query timeout

Property Description Default
adbc.spark.connect_timeout_ms Sets the timeout (in milliseconds) to open a new session. Values can be -1 (infinite) or greater than zero. 30000
adbc.statement.query_timeout_s Sets the maximum time (in seconds) for a query to complete. Values can be -1 (infinite) or greater than zero. 60
TODO: Dynamically update HTTP request timeout when statement option is updated dynamically.

These have changed now.

@birschick-bq
Copy link
Contributor Author

@CurtHagenlocher - A lot of churn on this PR - but I'd say it is ready for review, if you have the time. Thanks.

@birschick-bq birschick-bq marked this pull request as ready for review November 27, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants