Change in vdsm[ovirt-3.2]: After fail to connect to supervdsm more than 3 time vdsm get...

ybronhei at redhat.com ybronhei at redhat.com
Thu Feb 14 11:46:03 UTC 2013


Hello Saggi Mizrahi, Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/12053

to review the following change.

Change subject: After fail to connect to supervdsm more than 3 time vdsm gets into panic
......................................................................

After fail to connect to supervdsm more than 3 time vdsm gets into panic

Due to race between old supervdsm instance to the new instance after
prepareForShutdown, sometimes the socket is removed after
new supervdsm started to listen on it.
_pokeParent thread unlink the socket when distinguish that vdsm is dead.
This can take more time than the time that takes to vdsm to startup and
start the new instance of supervdsm. The unlink removes the socket file
and vdsm cannot communicate with supervdsm.
When the communication fails, vdsm calls panic and restart itself, this
will start supervdsm again as needed.

Change-Id: Iafe112893a76686edd2949d4f40b734646fd74df
Bug-Id: https://bugzilla.redhat.com/show_bug.cgi?id=910005
Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/11932
Reviewed-by: Saggi Mizrahi <smizrahi at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/supervdsm.py
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/12053/1

diff --git a/vdsm/supervdsm.py b/vdsm/supervdsm.py
index 6a38076..1b6402d 100644
--- a/vdsm/supervdsm.py
+++ b/vdsm/supervdsm.py
@@ -194,7 +194,14 @@
     def launch(self):
         self._firstLaunch = False
         self._start()
-        utils.retry(self._connect, Exception, timeout=60)
+        try:
+            # We retry 3 times to connect to avoid exceptions that are raised
+            # due to the process initializing. It might takes time to create
+            # the communication socket or other initialization methods take
+            # more time than expected.
+            utils.retry(self._connect, Exception, timeout=60)
+        except:
+            misc.panic("Couldn't connect to supervdsm")
 
     def __getattr__(self, name):
         return ProxyCaller(self, name)


--
To view, visit http://gerrit.ovirt.org/12053
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafe112893a76686edd2949d4f40b734646fd74df
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.2
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>


More information about the vdsm-patches mailing list