func: fix not unloading of unused modules
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. In fact, box.schema.func.drop() never unloaded anything. Moreover, when functions from the module were added again without a restart, it led to a second mmap of the same module. And so on, the same library could be loaded any number of times. The problem was in a useless flag in struct module preventing its unloading even when it is totally unused. It is dropped. Closes #4648
Showing
- src/box/func.c 9 additions, 7 deletionssrc/box/func.c
- src/box/func.h 0 additions, 2 deletionssrc/box/func.h
- src/lib/core/errinj.h 1 addition, 0 deletionssrc/lib/core/errinj.h
- test/box/function1.c 16 additions, 0 deletionstest/box/function1.c
- test/box/gh-4648-func-load-unload.result 137 additions, 0 deletionstest/box/gh-4648-func-load-unload.result
- test/box/gh-4648-func-load-unload.test.lua 63 additions, 0 deletionstest/box/gh-4648-func-load-unload.test.lua
- test/box/suite.ini 1 addition, 1 deletiontest/box/suite.ini
Loading
Please register or sign in to comment