-
Notifications
You must be signed in to change notification settings - Fork 13
add API to specify metadata request timeout #353
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
add API to specify metadata request timeout #353
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a new API function to allow users to configure server-side timeouts for metadata queries in the Cassandra driver. This addresses issues with large schemas where the default timeout may be too restrictive.
- Adds
cass_cluster_set_metadata_request_serverside_timeout
function to configure metadata query timeouts - Exposes existing Rust driver functionality through the C API
- Sets default timeout to 2 seconds with option to use cluster default by passing 0
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
include/cassandra.h |
Adds public API declaration with documentation for the new timeout function |
scylla-rust-wrapper/src/cluster.rs |
Implements the C function that sets metadata request timeout on the cluster configuration |
scylla-rust-wrapper/src/api.rs |
Exports the new function in the public API module |
Comments suppressed due to low confidence (1)
6cf974a
to
f3581c5
Compare
/** | ||
* Sets the server-side timeout for metadata queries. | ||
* | ||
* It means that all metadata queries will be set the given timeout | ||
* no matter what timeout is set as a cluster default. | ||
* This prevents timeouts of schema queries when the schema is large | ||
* and the default timeout is configured as tight. | ||
* | ||
* <b>Default:</b> 2 seconds. | ||
* | ||
* @public @memberof CassCluster | ||
* | ||
* @param[in] cluster | ||
* @param[in] timeout_ms Request timeout in milliseconds. Pass 0 to use cluster default timeout. | ||
*/ | ||
CASS_EXPORT void | ||
cass_cluster_set_metadata_request_serverside_timeout(CassCluster* cluster, | ||
cass_duration_t timeout_ms); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a dedicated setting for metadata client-side timeout?
If so, can we make it that:
- Default for server-side timeout is client-side timeout (perhaps with a slight reduction)
- There is a warning if users sets server-side higher than client-side?
If not, what client-side timeout is used? Can the above points apply to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a dedicated setting for metadata client-side timeout?
No.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not, what client-side timeout is used?
As with the other settings configured on execution profiles and on statements directly, the hierarchy is as follows:
statement > execution profile > cluster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the above points apply to it?
I'm not sure I understand.
This commit adds a new API function to the driver: `cass_cluster_set_metadata_request_serverside_timeout`. This function allows users to set a server-side timeout for metadata queries, which is particularly useful for large schemas where the default timeout may be too tight. The default timeout is set to 2 seconds (as in Rust Driver), and users can pass 0 to use the cluster's default timeout. This simply exposes the existing Rust Driver's API. Fixes: scylladb#172
f3581c5
to
59a11f6
Compare
This adds a new API function to the driver:
cass_cluster_set_metadata_request_serverside_timeout
. This function allows users to set a server-side timeout for metadata queries, which is particularly useful for large schemas where the default timeout may be too tight. The default timeout is set to 2 seconds (as in Rust Driver), and users can pass 0 to use the cluster's default timeout. This simply exposes the existing Rust Driver's API.Fixes: #172
Pre-review checklist
[ ] I have implemented Rust unit tests for the features/changes introduced.[ ] I have enabled appropriate tests inMakefile
in{SCYLLA,CASSANDRA}_(NO_VALGRIND_)TEST_FILTER
.Fixes:
annotations to PR description.