-
Notifications
You must be signed in to change notification settings - Fork 310
Closed
Labels
type: bugA general bugA general bug
Milestone
Description
Hi there,
I noticed a discrepancy between the comments and error messages in the QueryOptions.ReadTimeout method and the actual behavior of the code.
I suggest allowing the code to accept 0 without raising an exception to handle disabling the timeout.
Lines 540 to 556 in 100b267
/** | |
* Sets the request timeout. Overrides the default timeout. | |
* | |
* @param timeout the read timeout. Negative values are not allowed. If it is {@code 0}, the read timeout will be | |
* disabled for this statement. | |
* @return {@code this} {@link QueryOptionsBuilder} | |
* @see com.datastax.oss.driver.api.core.cql.SimpleStatement#setTimeout(Duration) | |
* @since 3.0 | |
*/ | |
public QueryOptionsBuilder timeout(Duration timeout) { | |
Assert.isTrue(!timeout.isZero() && !timeout.isNegative(), "ReadTimeout must be greater than equal to zero"); | |
this.timeout = timeout; | |
return this; | |
} |
I've also submitted a PR to address this. I would appreciate it if you could review it.
Thank you.
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug