[patches] [PATCH 1/1] test: ensure on_disconnect trigger is called on outstanding reqs

Vladimir Davydov vdavydov.dev at gmail.com
Mon Feb 12 16:35:49 MSK 2018


On Mon, Feb 12, 2018 at 04:20:17PM +0300, Vladislav Shpilevoy wrote:
> diff --git a/test/box/net.box.test.lua b/test/box/net.box.test.lua
> index 378dfd4ab..bd5bb9591 100644
> --- a/test/box/net.box.test.lua
> +++ b/test/box/net.box.test.lua
> @@ -871,4 +871,22 @@ while disconnected == false do fiber.sleep(0.01) end
>  disconnected -- true
>  
>  box.session.on_disconnect(nil, on_disconnect)
> +
> +--
> +-- gh-2998: on_disconnect is not called if a connection is closed
> +-- with outstanding requests.
> +--
> +disconnected = false
> +long_fiber = nil
> +function set_on_disconnect() box.session.on_disconnect(function() disconnected = true end) end
> +function long_poll() long_fiber = fiber.self() fiber.sleep(3000) end
> +
> +c = net.connect(box.cfg.listen)
> +c:call('set_on_disconnect')
> +_ = fiber.create(function() c:call('long_poll') end)
> +long_fiber ~= nil
> +c:close()
> +disconnected
> +long_fiber:cancel()
> +disconnected
>  box.schema.user.revoke('guest', 'execute', 'universe')

Isn't it the same as what is checked by commit 32f1c3489990 ("test:
check that connection does not leak if there is long call")?



More information about the Tarantool-patches mailing list