Skip to content
Snippets Groups Projects
Commit 50ce6ebe authored by Nikolay Shirokovskiy's avatar Nikolay Shirokovskiy Committed by Vladimir Davydov
Browse files

net.box: finish worker fiber on Tarantool shutdown

Let's make sure net.box system fiber is finished on Tarantool shutdown as
we are going to free fibers stacks. If fiber is not finished it's stack
may have references to objects on heap. Thus as fiber stack will be freed
we will have FP memory leaks under ASAN.

Part of #9722

NO_CHANGELOG=internal
NO_DOC=internal
parent 421b9086
No related branches found
No related tags found
No related merge requests found
......@@ -3167,6 +3167,7 @@ luaT_netbox_transport_start(struct lua_State *L)
transport->self_ref = LUA_NOREF;
return luaT_error(L);
}
fiber_set_managed_shutdown(transport->worker);
transport->worker->f_arg = transport;
/*
* Code that needs a temporary fiber-local Lua state may save some time
......
......@@ -200,3 +200,31 @@ g_standby.test_shutdown_during_hot_standby = function(cg)
end)
test_no_hang_on_shutdown(cg.standby)
end
local g_netbox = t.group('netbox')
g_netbox.before_each(function(cg)
cg.server = server:new()
cg.server:start()
cg.peer = server:new()
cg.peer:start()
end)
g_netbox.after_each(function(cg)
if cg.server ~= nil then
cg.server:drop()
end
if cg.peer ~= nil then
cg.peer:drop()
end
end)
-- Test shutdown with netbox connection.
g_netbox.test_netbox_shutdown = function(cg)
cg.server:exec(function(uri)
local netbox = require('net.box')
local c = netbox.connect(uri)
rawset(_G, 'test_connection', c)
end, {cg.peer.net_box_uri})
test_no_hang_on_shutdown(cg.server)
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment