You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
init.lua is executed before the server binds to primary/secondary ports, but can insert data, create connections, etc. - in other words, requires a running event loop.
In fact there is no running event loop, and first and any yield in init.lua script takes it off execution and the script is only resumed after general loading is complete, as part of the main server loop.
This creates ugly race conditions, when parts of init.lua are executed concurrently with insert/update/delete requests on the server port.
How to repeat:
add box.fiber.sleep(10000) into init.lua and observe the server doesn't sleep,
but starts and runs
Or:
add box.fiber.sleep() followed by box.insert(), and observe that at start
there is no tuple inserted into the space, i.e. init.lua is not finished before the main loop begins.
How to fix:
In tarantool_lua_load_init_script run the event loop until the init script completes. Then break the loop, finish bootstrap and resume the loop.
The text was updated successfully, but these errors were encountered:
init.lua is executed before the server binds to primary/secondary ports, but can insert data, create connections, etc. - in other words, requires a running event loop.
In fact there is no running event loop, and first and any yield in init.lua script takes it off execution and the script is only resumed after general loading is complete, as part of the main server loop.
This creates ugly race conditions, when parts of init.lua are executed concurrently with insert/update/delete requests on the server port.
How to repeat:
add box.fiber.sleep(10000) into init.lua and observe the server doesn't sleep,
but starts and runs
Or:
add box.fiber.sleep() followed by box.insert(), and observe that at start
there is no tuple inserted into the space, i.e. init.lua is not finished before the main loop begins.
How to fix:
In tarantool_lua_load_init_script run the event loop until the init script completes. Then break the loop, finish bootstrap and resume the loop.
The text was updated successfully, but these errors were encountered: