bbotella commented on code in PR #3365:
URL: https://github.com/apache/cassandra/pull/3365#discussion_r1633926811
##########
test/distributed/org/apache/cassandra/fuzz/sai/MultiNodeSAITest.java:
##########
@@ -45,7 +45,10 @@ public static void before() throws Throwable
cluster = Cluster.build()
.withNodes(2)
// At lower fetch sizes, queries w/ hundreds or
thousands of matches can take a very long time.
- .withConfig(InJvmSutBase.defaultConfig().andThen(c ->
c.set("range_request_timeout", "180s").set("read_request_timeout", "180s")
+ .withConfig(InJvmSutBase.defaultConfig().andThen(c ->
c.set("range_request_timeout", "180s")
Review Comment:
Nit: Maybe worth extracting that `180s` to a constant?
##########
test/harry/main/org/apache/cassandra/harry/sut/injvm/InJvmSutBase.java:
##########
@@ -144,38 +144,41 @@ public Object[][] execute(String statement,
ConsistencyLevel cl, int coordinator
if (isShutdown.get())
throw new RuntimeException("Instance is shut down");
- try
+ while (true)
{
- if (cl == ConsistencyLevel.NODE_LOCAL)
- {
- return cluster.get(coordinator)
- .executeInternal(statement, bindings);
- }
- else if (StringUtils.startsWithIgnoreCase(statement, "SELECT"))
+ try
{
- return Iterators.toArray(cluster
- // round-robin
- .coordinator(coordinator)
- .executeWithPaging(statement,
toApiCl(cl), pageSize, bindings),
- Object[].class);
+ if (cl == ConsistencyLevel.NODE_LOCAL)
+ {
+ return cluster.get(coordinator)
+ .executeInternal(statement, bindings);
+ }
+ else if (StringUtils.startsWithIgnoreCase(statement, "SELECT"))
+ {
+ return Iterators.toArray(cluster
+ // round-robin
+ .coordinator(coordinator)
+ .executeWithPaging(statement,
toApiCl(cl), pageSize, bindings),
+ Object[].class);
+ }
+ else
+ {
+ return cluster
+ // round-robin
+ .coordinator(coordinator)
+ .execute(statement, toApiCl(cl), bindings);
+ }
}
- else
+ catch (Throwable t)
{
- return cluster
- // round-robin
- .coordinator(coordinator)
- .execute(statement, toApiCl(cl), bindings);
- }
- }
- catch (Throwable t)
- {
- if (retryStrategy.apply(t))
- return execute(statement, cl, bindings);
+ if (retryStrategy.apply(t))
+ continue;
Review Comment:
Just a question for my education. Are we not applying some backoff or delay
between retries?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]