[ovs-git] [openvswitch/ovs] c1aa16: ovs python: ovs.stream.open_block() returns succes...

GitHub noreply at github.com
Tue Aug 14 18:49:54 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: c1aa16d191d267d76ce1d1459fe9ed6ab93e1f54
      https://github.com/openvswitch/ovs/commit/c1aa16d191d267d76ce1d1459fe9ed6ab93e1f54
  Author: Numan Siddique <nusiddiq at redhat.com>
  Date:   2018-08-14 (Tue, 14 Aug 2018)

  Changed paths:
    M python/ovs/poller.py
    M python/ovs/socket_util.py
    M python/ovs/stream.py
    M tests/automake.mk
    M tests/ovsdb-idl.at
    A tests/test-stream.py

  Log Message:
  -----------
  ovs python: ovs.stream.open_block() returns success even if the remote is unreachable

The python function ovs.socket_util.check_connection_completion() uses select()
(provided by python) to monitor the socket file descriptor. The select()
returns 1 when the file descriptor becomes ready. For error cases like -
111 (Connection refused) and 113 (No route to host) (POLLERR), ovs.poller._SelectSelect.poll()
expects the exceptfds list to be set by select(). But that is not the case.
As per the select() man page, writefds list will be set for POLLERR.
Please see "Correspondence between select() and poll() notifications" section of select(2)
man page.

Because of this behavior, ovs.socket_util.check_connection_completion() returns success
even if the remote is unreachable or not listening on the port.

This patch fixes this issue by using poll() to check the connection status similar to
the C implementation of check_connection_completion().

A new function 'get_system_poll() is added in ovs/poller.py which returns the
select.poll() object. If select.poll is monkey patched by eventlet/gevent, it
gets the original select.poll() and returns it.

The test cases added in this patch fails without the fix.

Suggested-by: Ben Pfaff <blp at ovn.org>
Signed-off-by: Numan Siddique <nusiddiq at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Mark Michelson <mmichels at redhat.com>


  Commit: 31e434fc985c682708f5d92bde2ceae452bdaa4f
      https://github.com/openvswitch/ovs/commit/31e434fc985c682708f5d92bde2ceae452bdaa4f
  Author: Numan Siddique <nusiddiq at redhat.com>
  Date:   2018-08-14 (Tue, 14 Aug 2018)

  Changed paths:
    M python/ovs/db/idl.py
    M python/ovs/jsonrpc.py
    M tests/ovsdb-idl.at
    M tests/test-ovsdb.py

  Log Message:
  -----------
  python jsonrpc: Allow jsonrpc_session to have more than one remote.

Python IDL implementation doesn't have the support to connect to the
cluster dbs. This patch adds this support. We are still missing the
support in python idl class to connect to the cluster master. That
support will be added in an upcoming patch.

This patch is similar to the commit 8cf6bbb184 which added multiple remote
support in the C jsonrpc implementation.

Acked-by: Mark Michelson <mmichels at redhat.com>
Signed-off-by: Numan Siddique <nusiddiq at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/44a629b5b80b...31e434fc985c
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the git mailing list