• Binbin's avatar
    SCRIPT FLUSH run truly async, close lua interpreter in bio (#13087) · a7abc2f0
    Binbin authored
    Even if we have SCRIPT FLUSH ASYNC now, when there are a lot of
    lua scripts, SCRIPT FLUSH ASYNC will still block the main thread.
    This is because lua_close is executed in the main thread, and lua
    heap needs to release a lot of memory.
    
    In this PR, we take the current lua instance on lctx.lua and call
    lua_close on it in a background thread, to close it in async way.
    This is MeirShpilraien's idea.
    a7abc2f0
eval.c 60.6 KB