[ovs-git] [openvswitch/ovs] 257edb: python: jsonrpc: Pick new remote on disconnect.

GitHub noreply at github.com
Thu Dec 27 17:52:22 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 257edb1ae07c150023575dfb38ea8e539ad713de
      https://github.com/openvswitch/ovs/commit/257edb1ae07c150023575dfb38ea8e539ad713de
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2018-12-27 (Thu, 27 Dec 2018)

  Changed paths:
    M python/ovs/jsonrpc.py

  Log Message:
  -----------
  python: jsonrpc: Pick new remote on disconnect.

If attempt to open non-blocking connection results with EINPROGRESS,
further polling will trigger DISCONNECT action in case of failures.
While handling this action, jsonrpc python library closes the
connection but does not change the current remote. This leads to
subsequent connection to the same remote. And the story starts from
the beginning producing infinite attempts to connect to a single
remote regardless of existense of others. Like this:

 reconnect | DBG | tcp:127.0.0.1:45932: entering BACKOFF
 reconnect | INFO | tcp:127.0.0.1:45932: connecting...
 reconnect | DBG | tcp:127.0.0.1:45932: entering CONNECTING
 poller | DBG | 999-ms timeout
 reconnect | INFO | tcp:127.0.0.1:45932: connection attempt timed out
 reconnect | DBG | tcp:127.0.0.1:45932: entering BACKOFF
 poller | DBG | 0-ms timeout
 reconnect | INFO | tcp:127.0.0.1:45932: connecting...
 <...>
 reconnect | DBG | tcp:127.0.0.1:45932: entering CONNECTING
 poller | DBG | 1999-ms timeout
 reconnect | INFO | tcp:127.0.0.1:45932: connection attempt timed out
 reconnect | INFO | tcp:127.0.0.1:45932: waiting 4 seconds before reconnect
 reconnect | DBG | tcp:127.0.0.1:45932: entering BACKOFF
 <...>

Fix that by always picking the new remote on disconnect.
This mimics the behaviour of jsonrpc C library.

Fixes "multiple remotes" tests on FreeBSD.

CC: Numan Siddique <nusiddiq at redhat.com>
Fixes: 31e434fc985c ("python jsonrpc: Allow jsonrpc_session to have more than one remote.")
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: fe495d0c1de9703059ddfb9c0cdc2b523331ef52
      https://github.com/openvswitch/ovs/commit/fe495d0c1de9703059ddfb9c0cdc2b523331ef52
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2018-12-27 (Thu, 27 Dec 2018)

  Changed paths:
    M tests/ovsdb-idl.at

  Log Message:
  -----------
  ovsdb-idl.at: Better choosing of wrong ports.

On some systems (ex. FreeBSD) kernel could allocate outcoming tcp ports
too close to the listening port of ovsdb-server. This could lead to having
outcoming tcp port of test-ovsdb application equal to one of the
WRONG_PORTs. In this case self-connection to the WRONG_PORT succeeds and
fails the tests:

  WRONG_PORT_1=51835
  WRONG_PORT_2=51836
  remotes="tcp:127.0.0.1:51835,tcp:127.0.0.1:51834,tcp:127.0.0.1:51836"
  # lsof -P -n -i @127.0.0.1
  COMMAND     PID TYPE  NODE NAME
  ovsdb-ser 82174 IPv4   TCP 127.0.0.1:51834 (LISTEN)
  python2.7 82179 IPv4   TCP 127.0.0.1:51835->127.0.0.1:51835 (ESTABLISHED)
  python2.7 82179 IPv4   TCP 127.0.0.1:51836->127.0.0.1:51836 (ESTABLISHED)

  ./ovsdb-idl.at:312: $PYTHON $srcdir/test-ovsdb.py  -t10 idl \
                             $srcdir/idltest.ovsschema $remote
  Alarm clock
  ./ovsdb-idl.at:312: exit code was 1, expected 0

It's more likely to have outcoming port not equal to TCP_PORT + 101 or 102.
Let's use them instead.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: cb334fff715af0f4e0b0b7551bacbc76300bff60
      https://github.com/openvswitch/ovs/commit/cb334fff715af0f4e0b0b7551bacbc76300bff60
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2018-12-27 (Thu, 27 Dec 2018)

  Changed paths:
    M tests/ofproto-macros.at

  Log Message:
  -----------
  ofproto-macros.at: Ignore "Socket is not connected" log messages.

FreeBSD likely reports ENOTCONN instead of EPIPE/ECONNRESET in case
of sending to the disconnected socket.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: 05e5030d6022ff749184bd8ce044a7ac4523e351
      https://github.com/openvswitch/ovs/commit/05e5030d6022ff749184bd8ce044a7ac4523e351
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2018-12-27 (Thu, 27 Dec 2018)

  Changed paths:
    M tests/ovsdb-idl.at

  Log Message:
  -----------
  ovsdb-idl.at: Increase timeouts for tests with multiple remotes.

Tests with multiple remotes always involves connection attempts
to the wrong destinations. This includes few reconnection cycles
for 1 second each and also possible long timeouts for blocking
connections.

Let's increase the timeouts for these tests to allow them finish
successfully.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: c64795a41d3fd0ff55de9c4302950df186889d6b
      https://github.com/openvswitch/ovs/commit/c64795a41d3fd0ff55de9c4302950df186889d6b
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2018-12-27 (Thu, 27 Dec 2018)

  Changed paths:
    M .cirrus.yml

  Log Message:
  -----------
  cirrus: Enable tests on FreeBSD.

Since all the tests fixed to work properly on FreeBSD we
could enable running of the testsuite.

+ minor refactoring of the yml file.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


  Commit: 2c1e8022d19199010d0182b6f244bc574065e2d8
      https://github.com/openvswitch/ovs/commit/2c1e8022d19199010d0182b6f244bc574065e2d8
  Author: Ilya Maximets <i.maximets at samsung.com>
  Date:   2018-12-27 (Thu, 27 Dec 2018)

  Changed paths:
    M .cirrus.yml

  Log Message:
  -----------
  cirrus: Enable testing of Python3 and SSL.

This does not increase testing time significantly, but
increases the coverage.

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>


Compare: https://github.com/openvswitch/ovs/compare/8e905f7616dd...2c1e8022d191
      **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