echauchot commented on a change in pull request #18509:
URL: https://github.com/apache/flink/pull/18509#discussion_r793481044
##########
File path:
flink-connectors/flink-connector-cassandra/src/test/java/org/apache/flink/streaming/connectors/cassandra/CassandraConnectorITCase.java
##########
@@ -237,6 +245,30 @@ public static void startAndInitializeCassandra() {
CREATE_TABLE_QUERY.replace(TABLE_NAME_VARIABLE,
TABLE_NAME_PREFIX + "initial"));
}
+ private static void raiseCassandraRequestsTimeouts() {
+ try {
+ final Path configurationPath = TEMPORARY_FOLDER.newFile().toPath();
+ CASSANDRA_CONTAINER.copyFileFromContainer(
+ "/etc/cassandra/cassandra.yaml",
configurationPath.toAbsolutePath().toString());
+ String configuration =
+ new String(Files.readAllBytes(configurationPath),
StandardCharsets.UTF_8);
+ String patchedConfiguration =
+ configuration
+ .replace("request_timeout_in_ms: 10000",
"request_timeout_in_ms: 30000")
+ .replace(
+ "read_request_timeout_in_ms: 5000",
+ "read_request_timeout_in_ms: 15000")
+ .replace(
+ "write_request_timeout_in_ms: 2000",
+ "write_request_timeout_in_ms: 6000");
Review comment:
I agree, it is not future proof: if we change the container version,
defaults might change and the replacement would no longer work. I tried to be
quick but obviously not generic enough, ok for the regex. I chose to change the
defaults in the containers so that the solution could apply to all the requests
but there is also the other solution of adding a timeout with each request but
this seems error-prone (forget to set the timeouts in the future) to me. Would
you prefer this solution ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]