Nir Soffer has posted comments on this change.
Change subject: http protocol detection
......................................................................
Patch Set 5: Code-Review-1
Thinking more about it, we cannot use this to separate the xmlrpc and http servers.
Protocol detection assume that the first request represent all requests on some connection, so if I got an xmlrpc request, all other requests on this connection will be xmlrpc. This assumption is wrong as the same connection can be used by the engine for both xmlrpc and http.
Since we must support old engine, this can not be solved by using different connection pools on the engine side in future engine versions.
--
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(a)gmail.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No
Nir Soffer has posted comments on this change.
Change subject: json-rpc: Protocol detection
......................................................................
Patch Set 31:
(5 comments)
The issue in version 29 fixed, but I found few easy to fix issues.
Waiting for confirmation that xmlrpc works correctly with last engine stable release.
http://gerrit.ovirt.org/#/c/26300/31/vdsm/BindingXMLRPC.py
File vdsm/BindingXMLRPC.py:
Line 1131: self.xml_binding = xml_binding
Line 1132:
Line 1133: def detect(self, data):
Line 1134: return (data.startswith("PUT /") or data.startswith("GET /") or
Line 1135: data.startswith("POST /RPC2"))
Did you verify that both old and new engine versions use /RPC2?
Line 1136:
Line 1137: def handleSocket(self, client_socket, socket_address):
Line 1138: self.xml_binding.add_socket(client_socket, socket_address)
http://gerrit.ovirt.org/#/c/26300/31/vdsm/protocolDetector.py
File vdsm/protocolDetector.py:
Line 137: def wakeup(self):
Line 138: try:
Line 139: os.write(self._write_fd, '1')
Line 140: except OSError as e:
Line 141: if e.erron not in (errno.EAGAIN, errno.EINPROGRESS):
- A careless reviewer suggested to check EINPROGRESS here - should be EWOULDBLOCK.
- e.erron will raise AttriuteError, should be e.errno
- If we get EINTR, we should retry the call, otherwise the wakeup fill fail.
Line 142: raise
Line 143:
Line 144: def _cleanup_wakeup_pipe(self):
Line 145: try:
Line 144: def _cleanup_wakeup_pipe(self):
Line 145: try:
Line 146: os.read(self._read_fd, 128)
Line 147: except OSError as e:
Line 148: if e.erron not in (errno.EAGAIN, errno.EINPROGRESS):
- A careless reviewer suggested to check EINPROGRESS - here should be EWOULDBLOCK.
- e.erron will raise AttriuteError, should be e.errno
Line 149: raise
Line 150:
Line 151: def _accept_connection(self):
Line 152: client_socket, _ = self._socket.accept()
Line 171: _, client_socket = self._pending_connections[fd]
Line 172: try:
Line 173: data = client_socket.recv(self._required_size, socket.MSG_PEEK)
Line 174: except socket.error as e:
Line 175: if e.errno not in (errno.EAGAIN, errno.EINPROGRESS):
- A careless reviewer suggested to check EINPROGRESS here - should be EWOULDBLOCK.
Line 176: self.log.warning("Not able to read data")
Line 177: self._remove_connection(client_socket)
Line 178: client_socket.close()
Line 179: return
Line 198: % (self._host, str(self._port)))
Line 199: server_socket = socket.socket(addr[0][0], addr[0][1], addr[0][2])
Line 200: server_socket.bind(addr[0][4])
Line 201: server_socket.listen(5)
Line 202: utils.closeOnExec(server_socket.fileno())
This must be done as soon as possible after creating the socket. Performing it after possibly blocking operation like bind and listen is not a good idea.
Line 203:
Line 204: if self._sslctx:
Line 205: server_socket = SSLServerSocket(raw=server_socket,
Line 206: certfile=self._sslctx.cert_file,
--
To view, visit http://gerrit.ovirt.org/26300
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id739a40e2b37dcc175137ec91cd5ec166ad24a75
Gerrit-PatchSet: 31
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Barak Azulay <bazulay(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Liron Ar <laravot(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
Vinzenz Feenstra has uploaded a new change for review.
Change subject: virt: Ensure not to handle no longer tacked fds in epoll
......................................................................
virt: Ensure not to handle no longer tacked fds in epoll
In some cases it is possible that events from epoll are received before the
socket is closed. This patch ensures that we're still tracking the fd for
which we're receiving the event.
Change-Id: Idde0f89d2859107dd1bb697d1753709137335677
Bug-Url: https://bugzilla.redhat.com/1102072
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/virt/vmchannels.py
1 file changed, 13 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/79/28179/1
diff --git a/vdsm/virt/vmchannels.py b/vdsm/virt/vmchannels.py
index d31cd47..67fb602 100644
--- a/vdsm/virt/vmchannels.py
+++ b/vdsm/virt/vmchannels.py
@@ -58,15 +58,19 @@
self.log.debug("Received %.08X. On fd removed by epoll.",
event)
elif (event & select.EPOLLIN):
- obj = self._channels[fileno]
- obj['reconnects'] = 0
- try:
- if obj['read_cb'](obj['opaque']):
- obj['read_time'] = time.time()
- else:
- reconnect = True
- except:
- self.log.exception("Exception on read callback.")
+ obj = self._channels.get(fileno, None)
+ if obj:
+ obj['reconnects'] = 0
+ try:
+ if obj['read_cb'](obj['opaque']):
+ obj['read_time'] = time.time()
+ else:
+ reconnect = True
+ except:
+ self.log.exception("Exception on read callback.")
+ else:
+ self.log.debug("Received epoll event %.08X for no longer "
+ "untracked fd = %d", event, fileno)
if reconnect:
self._prepare_reconnect(fileno)
--
To view, visit http://gerrit.ovirt.org/28179
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idde0f89d2859107dd1bb697d1753709137335677
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Nir Soffer has posted comments on this change.
Change subject: json-rpc: Protocol detection
......................................................................
Patch Set 31:
Can you describe in details how did you verify this?
In particular, which version of engine did you test? Remember that vdsm must support any previous version of engine.
--
To view, visit http://gerrit.ovirt.org/26300
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id739a40e2b37dcc175137ec91cd5ec166ad24a75
Gerrit-PatchSet: 31
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Barak Azulay <bazulay(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Liron Ar <laravot(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr(a)redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei(a)redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: No