summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2020-06-17 13:37:38 +0530
committerkshithijiyer <kshithij.ki@gmail.com>2020-06-17 17:52:10 +0530
commit7a33280b5ef65edb8845a19332938c69e1fea003 (patch)
tree8f6641182e9649d8efc6c56d93220995987183dc /glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
parentd5e3ddbb0b16e4143d6b2cb772d485bb044abfcd (diff)
[Libfix] Add retry logic to restart_glusterd()
Problem: Patch [1] and [2] sent to glusterfs where changes are made to glusterd.service.in to not allow glusterd restart for more than 6 times within an hour, due this glusterd restarts present in testcases may fail as there is no way to figure out when we reach the 6 restart limit. Fix: Add code to check if glusterd restart has failed if true then call reset_failed_glusterd(), and redo the restart. Links: [1] https://review.gluster.org/#/c/glusterfs/+/23751/ [2] https://review.gluster.org/#/c/glusterfs/+/23970/ Change-Id: I041a019f9a8757d8fead00302e6bbcd6563dc74e Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/gluster_base_class.py')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/gluster_base_class.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
index 93e906fdb..d27b9ad3e 100644
--- a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
+++ b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
@@ -45,8 +45,7 @@ from glustolibs.gluster.peer_ops import (
peer_probe_servers, peer_status
)
from glustolibs.gluster.gluster_init import (
- restart_glusterd, stop_glusterd, wait_for_glusterd_to_start,
- reset_failed_glusterd)
+ restart_glusterd, stop_glusterd, wait_for_glusterd_to_start)
from glustolibs.gluster.samba_libs import share_volume_over_smb
from glustolibs.gluster.volume_libs import (
cleanup_volume,
@@ -291,18 +290,8 @@ class GlusterBaseClass(TestCase):
return False
ret = restart_glusterd(cls.servers)
if not ret:
- # Due to recent changes in glusterd.service.in
- # we can only restart glusterd 6 times in an hour
- # if not then we would need reset-failed glusterd
- # and restart glusterd
- ret = reset_failed_glusterd(cls.servers)
- if not ret:
- g.log.error("Failed to reset glusterd")
- return False
- ret = restart_glusterd(cls.servers)
- if not ret:
- g.log.error("Failed to start glusterd")
- return False
+ g.log.error("Failed to start glusterd")
+ return False
sleep(2)
ret = wait_for_glusterd_to_start(cls.servers)
if not ret: