On 19 August 2018 at 00:12, Ben Pfaff <b...@ovn.org> wrote: > On Sat, Aug 18, 2018 at 09:40:05PM +0200, Simon Horman wrote: > > On Tue, Aug 07, 2018 at 05:07:58PM +0530, nusid...@redhat.com wrote: > > > From: Numan Siddique <nusid...@redhat.com> > > > > > > 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 <b...@ovn.org> > > > Signed-off-by: Numan Siddique <nusid...@redhat.com> > > > > I believe that this patch is the cause of the testsuite failure currently > > exhibited in the master branch when tested using travis-ci. > > > > https://travis-ci.org/openvswitch/ovs/jobs/417506303 > > > > ... > > > > > diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at > > > index 014382850..e8a26e971 100644 > > > --- a/tests/ovsdb-idl.at > > > +++ b/tests/ovsdb-idl.at > > > @@ -1720,3 +1720,19 @@ OVSDB_CHECK_IDL_COMPOUND_INDEX_WITH_REF([set, > simple3 idl-compound-index-with-re > > > 007: check simple4: empty > > > 008: End test > > > ]]) > > > + > > > +m4_define([CHECK_STREAM_OPEN_BLOCK_PY], > > > + [AT_SETUP([$1]) > > > + AT_SKIP_IF([test $2 = no]) > > > + AT_KEYWORDS([Check PY Stream open block - $3]) > > > + AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"]) > > > + PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT]) > > > + WRONG_PORT=$(($TCP_PORT+1)) > > > + AT_CHECK([$3 $srcdir/test-stream.py tcp:127.0.0.1:$TCP_PORT], > [0], [ignore]) > > > + AT_CHECK([$3 $srcdir/test-stream.py tcp:127.0.0.1:$WRONG_PORT], > [1], [ignore]) > > > + OVSDB_SERVER_SHUTDOWN > > > + AT_CHECK([$3 $srcdir/test-stream.py tcp:127.0.0.1:$TCP_PORT], > [1], [ignore]) > > > + AT_CLEANUP]) > > > + > > > +CHECK_STREAM_OPEN_BLOCK_PY([Check PY2 Stream open block], > [$HAVE_PYTHON], [$PYTHON]) > > > +CHECK_STREAM_OPEN_BLOCK_PY([Check PY3 Stream open block], > [$HAVE_PYTHON], [$PYTHON3]) > > > > I wonder if the problem exhibited by travis-ci would be resolved > > by changing $HAVE_PYTHON to $HAVE_PYTHON3 on the "PY3 Stream" line. > > > > Also, I wonder if s/PYTHON/PYTHON2/ is appropriate on the "PY2 Stream" > line. > > You're right, thanks. I sent a fix: > https://patchwork.ozlabs.org/patch/959273/
Thanks Ben, much appreciated. _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev