On Wed, Jul 11, 2018 at 12:56:39AM +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 adding a wrapper function - > check_connection_completion_status() > which calls sock.connect_ex() to get the status of the connection if > ovs.socket_util.check_connection_completion() returns success. > > The test cases added fails without the fix in this patch. > > Signed-off-by: Numan Siddique <nusid...@redhat.com>
Can we just code check_connection_completion() like we do in C, by directly using select() on Windows and poll() everywhere else? The approach in this patch seems a little indirect to me. Thanks, Ben. _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev