ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntikho...@apache.org
Subject [3/5] ignite git commit: Fix retrying logic
Date Tue, 31 Oct 2017 15:41:03 GMT
Fix retrying logic

Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9c9b375a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9c9b375a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9c9b375a

Branch: refs/heads/ignite-6252
Commit: 9c9b375a317755e1d063a59b16ec696fc9116070
Parents: 8cfaceb
Author: sunnychanwork <sunnychanwork@users.noreply.github.com>
Authored: Thu Sep 7 10:10:20 2017 +0800
Committer: GitHub <noreply@github.com>
Committed: Thu Sep 7 10:10:20 2017 +0800

----------------------------------------------------------------------
 .../cassandra/session/CassandraSessionImpl.java    | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9c9b375a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
----------------------------------------------------------------------
diff --git a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
index 9e42477..29bbab6 100644
--- a/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
+++ b/modules/cassandra/store/src/main/java/org/apache/ignite/cache/store/cassandra/session/CassandraSessionImpl.java
@@ -213,6 +213,7 @@ public class CassandraSessionImpl implements CassandraSession {
                 Throwable tblAbsenceEx = null;
                 Throwable hostsAvailEx = null;
                 Throwable prepStatEx = null;
+                boolean retry = false;
 
                 List<Cache.Entry<Integer, ResultSetFuture>> futResults = new
LinkedList<>();
 
@@ -266,13 +267,19 @@ public class CassandraSessionImpl implements CassandraSession {
                     throw new IgniteException(errorMsg, unknownEx);
 
                 // Remembering any of last errors.
-                if (tblAbsenceEx != null)
+                if (tblAbsenceEx != null) {
+                    retry = true;
                     error = tblAbsenceEx;
-                else if (hostsAvailEx != null)
+                }
+                else if (hostsAvailEx != null) {
+                    retry = true;
                     error = hostsAvailEx;
-                else if (prepStatEx != null)
+                }
+                else if (prepStatEx != null) {
+                    retry = true;
                     error = prepStatEx;
-
+                }
+                
                 // Clean errors info before next communication with Cassandra.
                 unknownEx = null;
                 tblAbsenceEx = null;
@@ -304,7 +311,7 @@ public class CassandraSessionImpl implements CassandraSession {
                     throw new IgniteException(errorMsg, unknownEx);
 
                 // If there are no errors occurred it means that operation successfully completed
and we can return.
-                if (tblAbsenceEx == null && hostsAvailEx == null && prepStatEx
== null && error!=null)
+                if (tblAbsenceEx == null && hostsAvailEx == null && prepStatEx
== null && !retry)
                     return assistant.processedData();
 
                 if (tblAbsenceEx != null) {


Mime
View raw message