Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja.osipov@gmail.com>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 2/2] func: fix not unloading of unused modules
Date: Wed, 27 Nov 2019 11:41:04 +0300	[thread overview]
Message-ID: <20191127084104.GD2752@atlas> (raw)
In-Reply-To: <b950ab940eaf5664639c80ec4ef928aa4ed0340f.1574810891.git.v.shpilevoy@tarantool.org>

* Vladislav Shpilevoy <v.shpilevoy@tarantool.org> [19/11/27 11:15]:
> C functions are loaded from .so/.dylib dynamic libraries. A
> library is loaded when any function from there is called first
> time. And was supposed to be unloaded, when all its functions are
> dropped from the schema (box.schema.func.drop()), and none of them
> is still in a call. But the unloading part was broken.

Wow. This is damn genius!

It never occurred to me that error injections could be used to
test some obscure code paths.

The impact of this on testing is going to be huge.
>  module_gc(struct module *module)
>  {
> -	if (!module->is_unloading || !rlist_empty(&module->funcs) ||
> -	     module->calls != 0)
> -		return;
> -	module_delete(module);
> +	if (rlist_empty(&module->funcs) && module->calls == 0)
> +		module_delete(module);
>  }

This is LGTM. Georgy wrote the original patches so you may want
to solicit his review as well.
> +f1:wakeup()
> + | ---
> + | ...
> +test_run:wait_cond(function() return f1:status() == 'dead' end)
> + | ---
> + | - true
> + | ...
> +check_module_count_diff(0)
> + | ---
> + | ...
> +
> +f2:wakeup()

This is a bit hackish way to cancel a sleep. I thought we had
errinj_sleep injection which would reliably cancel a sleep when
you clear it? If there is no such function I don't think 
it is a blocker for this patch to get in as is.

-- 
Konstantin Osipov, Moscow, Russia

  reply	other threads:[~2019-11-27  8:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 23:29 [Tarantool-patches] [PATCH 0/2] Module is not unloaded on function drop Vladislav Shpilevoy
2019-11-26 23:29 ` [Tarantool-patches] [PATCH 1/2] errinj: provide 'get' method in Lua Vladislav Shpilevoy
2019-11-27  8:35   ` Konstantin Osipov
2019-11-26 23:29 ` [Tarantool-patches] [PATCH 2/2] func: fix not unloading of unused modules Vladislav Shpilevoy
2019-11-27  8:41   ` Konstantin Osipov [this message]
2019-11-27 22:24     ` Vladislav Shpilevoy
2019-12-10 14:22 ` [Tarantool-patches] [PATCH 0/2] Module is not unloaded on function drop Kirill Yukhin
2019-12-11 21:36   ` Alexander Turenko
2019-12-11 22:33   ` Vladislav Shpilevoy
2019-12-19  4:50 ` Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191127084104.GD2752@atlas \
    --to=kostja.osipov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 2/2] func: fix not unloading of unused modules' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox