Skip to content
Snippets Groups Projects
Commit e4f0987a authored by Denis Smirnov's avatar Denis Smirnov Committed by Дмитрий Кольцов
Browse files

box/module_cache: remove fiber_gc after the func call

It is incorrect to create savepoints and truncate fiber->gc region
in the module_func_call(), as the module's function can also call
fiber_gc(). Actually, there is no sense in this action.

Previously we had a problem while calling a module function.
in module_func_call():

1. create a savepoint to fiber->gc
2. evaluate an arbitrary function. Let's assume it is a C function
    that creates and deletes prepared statements. When they don't
    fit into statement cache anymore (and we haven't configured or
    box to use transaction), sql_stmt_cache_insert() would call a
    fiber_gc(). As a result we can truncate the gc region to an
    invalid state (the amount of the used blocks would be less than
    we hade before the savepoint from step 1).
3. call fiber_gc() again (a savepoint points to an already freed
    position).

NO_DOC=refactoring
NO_TEST=refactoring
NO_CHANGELOG=refactoring
parent a0925aff
No related branches found
No related tags found
No related merge requests found
Loading
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