Change in vdsm[master]: http protocol detection
nsoffer at redhat.com
nsoffer at redhat.com
Thu May 29 17:45:35 UTC 2014
Nir Soffer has posted comments on this change.
Change subject: http protocol detection
......................................................................
Patch Set 5:
(6 comments)
After rebase and tiny fix, this patch should be perfect, and its required for http://gerrit.ovirt.org/26741.
Without that patch, GET request may be dropped by the protocol acceptor.
http://gerrit.ovirt.org/#/c/27839/5/vdsm/BindingXMLRPC.py
File vdsm/BindingXMLRPC.py:
Line 1060: try:
Line 1061: method, rest = data.split(" ", 1)
Line 1062: except ValueError:
Line 1063: return False
Line 1064: return method == "POST" and rest.startswith("/RPC2")
After rebase, you need to remove the startwith("PUT /") check.
Line 1065:
Line 1066: def handleSocket(self, client_socket, socket_address):
Line 1067: self.xml_binding.add_socket(client_socket, socket_address)
Line 1068: self.log.debug("xml over http detected from %s", socket_address)
Line 1094: self.xml_binding.add_socket(client_socket, socket_address)
Line 1095: self.log.debug("http detected from %s", socket_address)
Line 1096:
Line 1097: def stop(self):
Line 1098: self.xml_binding.stop()
> This will try to stop the binding twice - you stop it also in XmlDetector.
stop api was removed.
http://gerrit.ovirt.org/#/c/27839/5/vdsm/clientIF.py
File vdsm/clientIF.py:
Line 84: self._generationID = str(uuid.uuid4())
Line 85: self.mom = None
Line 86: self.xml_detector = None
Line 87: self.stomp_detector = None
Line 88: self.http_detector = None
Not needed any more
Line 89: if _glusterEnabled:
Line 90: self.gluster = gapi.GlusterApi(self, log)
Line 91: else:
Line 92: self.gluster = None
Line 182: 'Please make sure it is installed.')
Line 183: else:
Line 184: xml_binding = BindingXMLRPC(self, self.log, host,
Line 185: default_bridge)
Line 186: xml_binding.start()
Please add a comment that order of detectors is important - xml detector must be before http detector.
Line 187: self.xml_detector = XmlDetector(xml_binding)
Line 188: self._acceptor.add_detector(self.xml_detector)
Line 189: self.http_detector = HttpDetector(xml_binding)
Line 190: self._acceptor.add_detector(self.http_detector)
Line 185: default_bridge)
Line 186: xml_binding.start()
Line 187: self.xml_detector = XmlDetector(xml_binding)
Line 188: self._acceptor.add_detector(self.xml_detector)
Line 189: self.http_detector = HttpDetector(xml_binding)
Use temporary
Line 190: self._acceptor.add_detector(self.http_detector)
Line 191:
Line 192: def _prepareJSONRPCBinding(self):
Line 193: if config.getboolean('vars', 'jsonrpc_enable'):
Line 239: self.xml_detector.stop()
Line 240: if self.stomp_detector:
Line 241: self.stomp_detector.stop()
Line 242: if self.http_detector:
Line 243: self.self.http_detector.stop()
Not needed any more
Line 244: self._acceptor.stop()
Line 245:
Line 246: self._enabled = False
Line 247: self.channelListener.stop()
--
To view, visit http://gerrit.ovirt.org/27839
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I4f899cbab4d95ebd184bf32f3ccec1f4fa0e49bc
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list