Piotr Kliczewski has uploaded a new change for review. Change subject: asyncore: use default handing of read event ......................................................................
asyncore: use default handing of read event It seems that we provided our own handle_read_event method due to assumption that we need to distinguish between fds which support pending and not. There are two fd types which do not provide pending method: plain socket and AsyncoreEvent which uses EventFD. Only our implementations of sslsocket provide pending. Default implementation do not care about it because it is not using pending and after several iteration of testing it seems to be OK. Change-Id: Ia4dd6856f5c08da459478c60ac1fe7881baa69a2 Signed-off-by: pkliczewski <piotr.kliczew...@gmail.com> --- M lib/yajsonrpc/betterAsyncore.py M tests/integration/jsonRpcTests.py 2 files changed, 1 insertion(+), 18 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/11/46911/1 diff --git a/lib/yajsonrpc/betterAsyncore.py b/lib/yajsonrpc/betterAsyncore.py index 50e8c75..e0f8c8b 100644 --- a/lib/yajsonrpc/betterAsyncore.py +++ b/lib/yajsonrpc/betterAsyncore.py @@ -80,23 +80,6 @@ default_func = lambda: None return getattr(self.__impl, "next_check_interval", default_func)() - def handle_read_event(self): - if self.accepting: - self.handle_accept() - return - - if not self.connected: - if self.connecting: - self.handle_connect_event() - - self.handle_read() - - # we need to check whether there is pending function on - # our fd because we use eventfds which do not provide it - if hasattr(self.socket, "pending"): - while self.socket.pending() > 0 and self.connected: - self.handle_read() - def recv(self, buffer_size): try: data = self.socket.recv(buffer_size) diff --git a/tests/integration/jsonRpcTests.py b/tests/integration/jsonRpcTests.py index b7fd97d..76a3531 100644 --- a/tests/integration/jsonRpcTests.py +++ b/tests/integration/jsonRpcTests.py @@ -76,7 +76,7 @@ self.server_address = None -def getInstance(): +def getInstance(cls=None): return FakeClientIf() -- To view, visit https://gerrit.ovirt.org/46911 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia4dd6856f5c08da459478c60ac1fe7881baa69a2 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Piotr Kliczewski <piotr.kliczew...@gmail.com> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches