You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by nt...@apache.org on 2017/10/31 15:41:03 UTC

[3/5] ignite git commit: Fix retrying logic

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 <su...@users.noreply.github.com>
Authored: Thu Sep 7 10:10:20 2017 +0800
Committer: GitHub <no...@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) {