From 143df4cd5e846d2e7b3d09dac924d1e8302809c0 Mon Sep 17 00:00:00 2001
From: Konstantin Osipov <kostja@tarantool.org>
Date: Tue, 17 Dec 2013 18:22:23 +0400
Subject: [PATCH] gh-136: review fixes, remove an unnecessary state variable.

---
 src/replica.cc | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/replica.cc b/src/replica.cc
index 24ad427218..4359523075 100644
--- a/src/replica.cc
+++ b/src/replica.cc
@@ -95,7 +95,6 @@ pull_from_remote(va_list ap)
 	struct ev_io coio;
 	struct iobuf *iobuf = NULL;
 	bool warning_said = false;
-	int reconnect_sleep = 0;
 	const int reconnect_delay = 1;
 
 	coio_init(&coio);
@@ -143,11 +142,10 @@ pull_from_remote(va_list ap)
 				warning_said = true;
 			}
 			evio_close(&coio);
-			reconnect_sleep = 1;
 		}
 
 		/* Put fiber_sleep() out of catch block.
-		 * 
+		 *
 		 * This is done to avoid situation, when two or more
 		 * fibers yield's inside their try/catch blocks and
 		 * throws an exceptions. Seems like exception unwinder
@@ -159,10 +157,8 @@ pull_from_remote(va_list ap)
 		 *
 		 * See: https://github.com/tarantool/tarantool/issues/136
 		*/
-		if (reconnect_sleep) {
+		if (! evio_is_active(&coio))
 			fiber_sleep(reconnect_delay);
-			reconnect_sleep = 0;
-		}
 	}
 }
 
-- 
GitLab