You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2020/10/15 17:48:51 UTC

[GitHub] [cassandra-diff] yifan-c opened a new pull request #13: Handle exceptions in JobMetadataDB

yifan-c opened a new pull request #13:
URL: https://github.com/apache/cassandra-diff/pull/13


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-diff] krummas commented on a change in pull request #13: Handle exceptions in JobMetadataDB

Posted by GitBox <gi...@apache.org>.
krummas commented on a change in pull request #13:
URL: https://github.com/apache/cassandra-diff/pull/13#discussion_r507696964



##########
File path: spark-job/src/main/java/org/apache/cassandra/diff/JobMetadataDb.java
##########
@@ -37,21 +38,45 @@
 import com.datastax.driver.core.Session;
 import com.datastax.driver.core.SimpleStatement;
 import com.datastax.driver.core.Statement;
+import com.datastax.driver.core.exceptions.DriverException;
+import com.datastax.driver.core.exceptions.NoHostAvailableException;
+import com.datastax.driver.core.exceptions.QueryConsistencyException;
+import com.datastax.driver.core.exceptions.QueryValidationException;
 import com.datastax.driver.core.utils.UUIDs;
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeZone;
 
 public class JobMetadataDb {
     private static final Logger logger = LoggerFactory.getLogger(JobMetadataDb.class);
 
+    @FunctionalInterface
+    private interface QueryExecution {
+        ResultSet execute() throws DriverException;
+    }
+
+    /**
+     * Ignore QueryConsistencyException (e.g. Read/Write timeout/failure) from the queryExecution.
+     * @param queryExecution
+     * @return resultSet. In the case of QueryConsistencyException, null is returned.
+     */
+    private static ResultSet ignoreQueryException(QueryExecution queryExecution) {
+        try {
+            return queryExecution.execute();
+        }
+        catch (QueryConsistencyException queryException) {
+            logger.error("Query failed.", queryException);

Review comment:
       maybe just `warn` here?

##########
File path: common/src/main/java/org/apache/cassandra/diff/RetryStrategy.java
##########
@@ -16,12 +17,28 @@
     protected abstract boolean shouldRetry();
 
     public final <T> T retry(Callable<T> retryable) throws Exception {
+        return retryIfNot(retryable, FakeException.class);

Review comment:
       why do we need FakeException here? Looks like just calling it without excluded exception would provide the same result




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-diff] michaelsembwever closed pull request #13: Handle exceptions in JobMetadataDB

Posted by GitBox <gi...@apache.org>.
michaelsembwever closed pull request #13:
URL: https://github.com/apache/cassandra-diff/pull/13


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org