ifesdjeen commented on code in PR #3365:
URL: https://github.com/apache/cassandra/pull/3365#discussion_r1634180310
##########
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:
We could apply backoff, but this is an in-jvm test, so the initial thinking
was that it's a very controlled environment.
--
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]