On Wed, Feb 27, 2019 at 12:45:58PM +0000, Ken Ajiro wrote:
> 
>   Hello,
> 
>   When I use ovs-ofctl on OVS 2.10.1, it failed occasionally by error:
> 
>     ovs-ofctl: br0: failed to connect to socket (Broken pipe)
> 
>   This error is possible to be reproduced with:
> 
>     # while :; do /opt/nec/pf/ds/bin/ovs-ofctl --timeout=5 dump-flows br0 > 
> /tmp/log || break; done; cat /tmp/log
>     ovs-ofctl: br0: failed to connect to socket (Broken pipe)
> 
>   Also I tried with OVS 2.4.1 and could not reproduce this error.
> 
>   I think that recently rconn.c was modified on commit 
> 476d2551abd2871696a64203f78d658ac2d7f32c
>   and the connection for ofctl was changed it begins on state S_CONNECTING 
> instead of S_ACTIVE.
>   So timeout_CONNECTING will be applied for ofctl connection, however 
> timeout_CONNECTING is 1
>   and this is too short (e.g. if transition time of CONNCTING was 
> 12:00:00.999, it will be timed out
>   after 1ms). I think that this is cause of occasionally disconnection of 
> ofctl.

Thanks for the report.

It seems to me that the right long-term fix is to use higher resolution
(e.g. millisecond resolution) to measure the timeouts.  However, that
will be a relatively large fix.

The following stopgap appears to fix the problem on master.  I suspect
it could be easily backported as far as necessary.  Does it work for you
too?

diff --git a/lib/rconn.c b/lib/rconn.c
index 48ae8c6a72e5..8ca23cbcfe90 100644
--- a/lib/rconn.c
+++ b/lib/rconn.c
@@ -502,7 +502,7 @@ static unsigned int
 timeout_CONNECTING(const struct rconn *rc)
     OVS_REQUIRES(rc->mutex)
 {
-    return MAX(1, rc->backoff);
+    return MAX(2, rc->backoff);
 }
 
 static void
_______________________________________________
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to