Yaniv Bronhaim has posted comments on this change.
Change subject: Using CrabRPC to communicate between vdsm and super vdsm
......................................................................
Patch Set 2: (3 inline comments)
The interface stays the same, you can try run it. you don't need to pass the pipes
each proxy call. checkout the tests, its an example of how to initiate supervdsm process
and communicate with it.
Uploading new patchset after adding code refers to your comments
....................................................
File vdsm/supervdsm.py
Line 49: return self
Line 50:
Line 51: def __call__(self, *args, **kwargs):
Line 52: return self.callCrabRPCFunction(DEFAULT_CALL_TIMEOUT,
Line 53: self._funcName, *args, **kwargs)
I can add isConnectionEstablished that verifies that ping works.. but i don't think it
useful. If it doesn't work we supposed to crash anyway, so maybe its better to add
watchdog thread that verifies the communication for that purpose.
I think its better to put __call__ function between try except, and if it fails we should
get into panic and vdsm should kill itself.
Line 54:
Line 55:
Line 56: def getProxy():
Line 57: global _g_singletonSupervdsmInstance
....................................................
File vdsm/vdsm
Line 133:
Line 134: vdsmPid = os.getpid()
Line 135: vdsm_r, svdsm_w = os.pipe()
Line 136: svdsm_r, vdsm_w = os.pipe()
Line 137: supervdsm.setPipe(vdsm_r, vdsm_w)
This startup code initiates pipe fds and set them to supervdsm and vdsm, start both
processes and control crashes and exit.
Do you prefer to see getProxy().setInternalFds(fd1,fd2) functions? why? here we're not
proxy users..
Line 138: son_pid = os.fork()
Line 139:
Line 140: if son_pid != 0:
Line 141: startSuperVdsm(svdsm_r, svdsm_w, son_pid)
Line 137: supervdsm.setPipe(vdsm_r, vdsm_w)
Line 138: son_pid = os.fork()
Line 139:
Line 140: if son_pid != 0:
Line 141: startSuperVdsm(svdsm_r, svdsm_w, son_pid)
We've already used multiprocessing objects and bump into internal bugs.. what benefits
does Process object give up? how is it easier to debug and maintain? what details do we
expose?
Line 142:
Line 143: else:
Line 144: dropPrivileges()
Line 145: log = initVdsmLogger()
--
To view, visit
http://gerrit.ovirt.org/11910
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I4f1053e7d1264003fa265e44899d8b02f98bd68a
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server