It's said in the section Lua Variable Scope that each request handler has its own set of Lua global variables.But It's not so in the source code here:
Only the version built without OpenResty's LuaJIT(eg. without the micro OPENRESTY_LUAJIT) can have a new table as global environment in each lua coroutine.
I also did experiment on two versions of OpenResty, one was built with OpenResty's LuaJIT and the other is built with official version of LuaJIT. I created two locations to set and get global variable like this:
In the result, the OpenResty's LuaJIT version successfully got the gloabl 'key' and the other version did't.
So why does lua-nginx has this global environment setting with different luajit version? Why doesn't OpenResty's LuaJIT need isolated global environment?
OpenResty version used in my issue: 1.21.4.3
It's said in the section Lua Variable Scope that each request handler has its own set of Lua global variables.But It's not so in the source code here:
Only the version built without OpenResty's LuaJIT(eg. without the micro OPENRESTY_LUAJIT) can have a new table as global environment in each lua coroutine.
I also did experiment on two versions of OpenResty, one was built with OpenResty's LuaJIT and the other is built with official version of LuaJIT. I created two locations to set and get global variable like this:
In the result, the OpenResty's LuaJIT version successfully got the gloabl 'key' and the other version did't.
So why does lua-nginx has this global environment setting with different luajit version? Why doesn't OpenResty's LuaJIT need isolated global environment?