Change in vdsm[master]: jsonrpc: make sure not to block when processing i/o
piotr.kliczewski at gmail.com
piotr.kliczewski at gmail.com
Tue Apr 12 09:33:13 UTC 2016
Piotr Kliczewski has posted comments on this change.
Change subject: jsonrpc: make sure not to block when processing i/o
......................................................................
Patch Set 2:
(3 comments)
Migration is using non-blocking code it should not break. I will update the commit message.
https://gerrit.ovirt.org/#/c/55872/2//COMMIT_MSG
Commit Message:
Line 10: Change-Id: I8dee39c7ec518721e809de1cb542173161612ffb
Line 11: Signed-off-by: pkliczewski <piotr.kliczewski at gmail.com>
Line 12: Bug-Url: https://bugzilla.redhat.com/1321325
Line 13: Bug-Url: https://bugzilla.redhat.com/1324155
Line 14: Bug-Url: https://bugzilla.redhat.com/1323465
> Something is wrong here, this patch does not change the behavior of the cod
The real issue is that we do not have a response from vdsm. It looks like we block from time to time when we should not. After testing different possibilities setting non-block made vdsm to be responsive. Usually it took 2 - 3 attempt and we reproduced the issue but when non-blocking socket was used good number of retries did not reproduce the issue.
The tests were performed on mburman's env.
https://gerrit.ovirt.org/#/c/55872/2/lib/vdsm/utils.py
File lib/vdsm/utils.py:
Line 849:
Line 850: def create_connected_socket(host, port, sslctx=None, timeout=None):
Line 851: addrinfo = socket.getaddrinfo(host, port,
Line 852: socket.AF_UNSPEC, socket.SOCK_STREAM)
Line 853: family, socktype, proto, _, _ = addrinfo[0]
> nir requested to do this change separately
Done
Line 854: sock = socket.socket(family, socktype, proto)
Line 855:
Line 856: if sslctx:
Line 857: sock = sslctx.wrapSocket(sock)
Line 857: sock = sslctx.wrapSocket(sock)
Line 858:
Line 859: sock.settimeout(timeout)
Line 860: sock.connect((host, port))
Line 861: sock.setblocking(0)
> Doing it here is adding a trap for other developers. Nobody expect a blocki
Will provide docstring for developers to be aware of what they are getting from this method.
Line 862: return sock
Line 863:
Line 864:
Line 865: @contextmanager
--
To view, visit https://gerrit.ovirt.org/55872
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8dee39c7ec518721e809de1cb542173161612ffb
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list