ljsonschema icon indicating copy to clipboard operation
ljsonschema copied to clipboard

Incompatable with OpenResty

Open gsomgsom opened this issue 7 years ago • 2 comments
trafficstars

Running example in LUA 5.1 is good. But when i'm trying to run example in OpenResty (with LuaJIT), it rises an error:

ERROR: attempt to yield across C-call boundary
stack traceback:
coroutine.wrap:21: in function coroutine.wrap:21
[C]: in function 'load'
./jsonschema/init.lua:169: in function 'generate_validator' test.lua:5: in function 'file_gen'
init_worker_by_lua:45: in function <init_worker_by_lua:43> [C]: in function 'xpcall'
init_worker_by_lua:52: in function <init_worker_by_lua:50>

gsomgsom avatar Feb 15 '18 09:02 gsomgsom

Thank you for your report. It turns out that openresty replace the coroutine API with its own one, that causes this error...

Not sure yet if this is a bug on the nginx-lua-module, or if that behaviour is expected.

Nevertheless, this is fixed by 09dccc59d96d88df352c0103344bb219f9e7579b that you can use with the borken-coro branch. But I need to asses the exact overhead of this fix before merging it.

jdesgats avatar Feb 17 '18 16:02 jdesgats

Thanks! It works fine for my project.

gsomgsom avatar Feb 20 '18 11:02 gsomgsom