summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java
index 898f75e9..e88ed876 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java
@@ -35,6 +35,7 @@ import org.openslx.bwlp.sat.thrift.cache.VirtualizerList;
import org.openslx.bwlp.sat.util.Configuration;
import org.openslx.bwlp.sat.util.Identity;
import org.openslx.bwlp.sat.web.WebServer;
+import org.openslx.bwlp.thrift.iface.TAuthorizationException;
import org.openslx.bwlp.thrift.iface.TInvalidTokenException;
import org.openslx.sat.thrift.version.Version;
import org.openslx.thrifthelper.ThriftManager;
@@ -97,16 +98,23 @@ public class App {
ThriftManager.setMasterErrorCallback(new ErrorCallback() {
+ /**
+ * Return true to retry call, false otherwise.
+ */
@Override
public boolean thriftError(int failCount, String method, Throwable t) {
+ // t == null means no connection could be established
if (failFastMethods.contains(method))
- return false;
+ return t != null && failCount <= 1;
if (failCount > 2 || t == null) {
LOGGER.warn("Thrift Client error for " + method + ", FAIL.");
return false;
}
- if (t instanceof TInvalidTokenException)
+ if ((t instanceof TInvalidTokenException)
+ || (t instanceof TAuthorizationException)
+ || !(t instanceof TException)) {
return false;
+ }
if (((TException) t).getCause() == null) {
LOGGER.info("Thrift error " + t.toString() + " for " + method + ", retrying...");
} else {