[ovs-dev] [PATCH] reconnect.c: Don't transition back to ACTIVE when forced to RECONNECT.

Han Zhou zhouhan at gmail.com
Thu Mar 21 16:55:15 UTC 2019


From: Han Zhou <hzhou8 at ebay.com>

Currently, whenever there is activity on the session, the FSM is
transitioned to ACTIVE. However, this causes reconnect_force_reconnect()
failed to work once there are traffic received from remote after
transition to RECONNECT, it will skip the reconnection phase and directly
go back to ACTIVE for the old session. This patch fixes it so that
when FSM is in RECONNECT state, it doesn't transition back to ACTIVE
directly.

Signed-off-by: Han Zhou <hzhou8 at ebay.com>
---
 lib/reconnect.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/reconnect.c b/lib/reconnect.c
index 0f21378..e2901ab 100644
--- a/lib/reconnect.c
+++ b/lib/reconnect.c
@@ -495,7 +495,7 @@ reconnect_connect_failed(struct reconnect *fsm, long long int now, int error)
 void
 reconnect_activity(struct reconnect *fsm, long long int now)
 {
-    if (fsm->state != S_ACTIVE) {
+    if (fsm->state != S_ACTIVE && fsm->state != S_RECONNECT) {
         reconnect_transition__(fsm, now, S_ACTIVE);
     }
     fsm->last_activity = now;
-- 
2.1.0



More information about the dev mailing list