From 600eede02799cb5e19cd767e6b80e9d096d574aa Mon Sep 17 00:00:00 2001 From: "Ranjith Manickam -T (ranmanic - COGNIZANT TECHNOLOGY SOLUTIONS INDIA PVT LTD at Cisco)" Date: Sun, 27 Nov 2016 17:28:53 +0530 Subject: [PATCH] Exception changes.. --- .../tomcat/session/data/cache/RedisCacheUtil.java | 15 +++++++++++++++ .../session/data/cache/RedisClusterCacheUtil.java | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/com/r/tomcat/session/data/cache/RedisCacheUtil.java b/src/com/r/tomcat/session/data/cache/RedisCacheUtil.java index c444346..9d2ec67 100644 --- a/src/com/r/tomcat/session/data/cache/RedisCacheUtil.java +++ b/src/com/r/tomcat/session/data/cache/RedisCacheUtil.java @@ -56,6 +56,9 @@ public class RedisCacheUtil implements IRequestSessionCacheUtils sucess = true; } catch (JedisConnectionException e) { log.error("Jedis connection failed, retrying..." + tries); + if (tries == numRetries) { + throw e; + } } } while (!sucess && tries <= numRetries); } @@ -76,6 +79,9 @@ public class RedisCacheUtil implements IRequestSessionCacheUtils sucess = true; } catch (JedisConnectionException e) { log.error("Jedis connection failed, retrying..." + tries); + if (tries == numRetries) { + throw e; + } } } while (!sucess && tries <= numRetries); return retVal; @@ -94,6 +100,9 @@ public class RedisCacheUtil implements IRequestSessionCacheUtils sucess = true; } catch (JedisConnectionException e) { log.error("Jedis connection failed, retrying..." + tries); + if (tries == numRetries) { + throw e; + } } } while (!sucess && tries <= numRetries); } @@ -114,6 +123,9 @@ public class RedisCacheUtil implements IRequestSessionCacheUtils sucess = true; } catch (JedisConnectionException e) { log.error("Jedis connection failed, retrying..." + tries); + if (tries == numRetries) { + throw e; + } } } while (!sucess && tries <= numRetries); return array; @@ -134,6 +146,9 @@ public class RedisCacheUtil implements IRequestSessionCacheUtils sucess = true; } catch (JedisConnectionException e) { log.error("Jedis connection failed, retrying..." + tries); + if (tries == numRetries) { + throw e; + } } } while (!sucess && tries <= numRetries); } diff --git a/src/com/r/tomcat/session/data/cache/RedisClusterCacheUtil.java b/src/com/r/tomcat/session/data/cache/RedisClusterCacheUtil.java index c99a09f..8187e31 100644 --- a/src/com/r/tomcat/session/data/cache/RedisClusterCacheUtil.java +++ b/src/com/r/tomcat/session/data/cache/RedisClusterCacheUtil.java @@ -54,6 +54,9 @@ public class RedisClusterCacheUtil implements IRequestSessionCacheUtils sucess = true; } catch (JedisClusterMaxRedirectionsException | JedisConnectionException e) { log.error("Jedis connection failed, retrying..." + tries); + if (tries == numRetries) { + throw e; + } waitforFailover(); } } while (!sucess && tries <= numRetries); @@ -73,6 +76,9 @@ public class RedisClusterCacheUtil implements IRequestSessionCacheUtils sucess = true; } catch (JedisClusterMaxRedirectionsException | JedisConnectionException e) { log.error("Jedis connection failed, retrying..." + tries); + if (tries == numRetries) { + throw e; + } waitforFailover(); } } while (!sucess && tries <= numRetries); @@ -90,6 +96,9 @@ public class RedisClusterCacheUtil implements IRequestSessionCacheUtils sucess = true; } catch (JedisClusterMaxRedirectionsException | JedisConnectionException e) { log.error("Jedis connection failed, retrying..." + tries); + if (tries == numRetries) { + throw e; + } waitforFailover(); } } while (!sucess && tries <= numRetries); @@ -109,6 +118,9 @@ public class RedisClusterCacheUtil implements IRequestSessionCacheUtils sucess = true; } catch (JedisClusterMaxRedirectionsException | JedisConnectionException e) { log.error("Jedis connection failed, retrying..." + tries); + if (tries == numRetries) { + throw e; + } waitforFailover(); } } while (!sucess && tries <= numRetries); @@ -128,6 +140,9 @@ public class RedisClusterCacheUtil implements IRequestSessionCacheUtils sucess = true; } catch (JedisClusterMaxRedirectionsException | JedisConnectionException e) { log.error("Jedis connection failed, retrying..." + tries); + if (tries == numRetries) { + throw e; + } waitforFailover(); } } while (!sucess && tries <= numRetries);