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

GitHub noreply at github.com
Wed Aug 15 17:19:22 UTC 2018


  Branch: refs/heads/branch-2.10
  Home:   https://github.com/openvswitch/ovs
  Commit: 206d62e33648944b7136693324b3032ef48a38b2
      https://github.com/openvswitch/ovs/commit/206d62e33648944b7136693324b3032ef48a38b2
  Author: Numan Siddique <nusiddiq at redhat.com>
  Date:   2018-08-15 (Wed, 15 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: 727767762034ff9b145342939ee856013f283625
      https://github.com/openvswitch/ovs/commit/727767762034ff9b145342939ee856013f283625
  Author: Numan Siddique <nusiddiq at redhat.com>
  Date:   2018-08-15 (Wed, 15 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/9501869ee550...727767762034
      **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