[patches] [PATCH 2/2] netbox: do not clog log with repeating reconnect error messages
v.shpilevoy at tarantool.org
v.shpilevoy at tarantool.org
Mon Mar 5 18:41:04 MSK 2018
Fixed some remarks after @kostja review.
diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua
index 5d86d6fb8..87c8c548b 100644
--- a/src/box/lua/net_box.lua
+++ b/src/box/lua/net_box.lua
@@ -359,6 +359,14 @@ local function create_transport(host, port, user, password, callback)
-- a state machine in Lua.
local console_sm, iproto_auth_sm, iproto_schema_sm, iproto_sm, error_sm
+ --
+ -- Protocol_sm is a core function of netbox. It calls all
+ -- other ..._sm() functions, and explicitly or implicitly
+ -- holds Lua referece on a connection object. It means, that
+ -- until it works, the connection can not be garbage
+ -- collected. See gh-3164, where because of reconnect sleeps
+ -- in this function, a connection could not be deleted.
+ --
protocol_sm = function ()
local tm_begin, tm = fiber.clock(), callback('fetch_connect_timeout')
connection = socket.tcp_connect(host, port, tm)
diff --git a/test/box/net.box.result b/test/box/net.box.result
index 1fda0d67d..898bc8087 100644
--- a/test/box/net.box.result
+++ b/test/box/net.box.result
@@ -2208,7 +2208,7 @@ weak = setmetatable({}, {__mode = 'v'})
...
-- Create strong and weak reference. Weak is valid until strong
-- is valid too.
-strong = net.connect(connect_to, {reconnect_after = 0.5})
+strong = net.connect(connect_to, {reconnect_after = 0.1})
---
...
weak.c = strong
diff --git a/test/box/net.box.test.lua b/test/box/net.box.test.lua
index a434528d6..b8cc90935 100644
--- a/test/box/net.box.test.lua
+++ b/test/box/net.box.test.lua
@@ -902,7 +902,7 @@ test_run:cmd("set variable connect_to to 'connecter.listen'")
weak = setmetatable({}, {__mode = 'v'})
-- Create strong and weak reference. Weak is valid until strong
-- is valid too.
-strong = net.connect(connect_to, {reconnect_after = 0.5})
+strong = net.connect(connect_to, {reconnect_after = 0.1})
weak.c = strong
weak.c:ping()
log.info(string.rep('a', 1000))
More information about the Tarantool-patches
mailing list