leafo / pgmoon

A pure Lua Postgres driver for use in OpenResty & more
MIT License
390 stars 93 forks source link

lua entry thread aborted: runtime error: attempt to yield across C-call boundary #135

Closed mnegovanovic closed 1 year ago

mnegovanovic commented 1 year ago

Hi,

openresty 1.21.4.1-1 pgmoon 1.16.0-1

local pgmoon = require("pgmoon") local pg = pgmoon.new({ host = "127.0.0.1", port = "5432", database = "test", user = "test", password = "test", socket_type = "nginx" }) pg:connect()

I am getting this error in nginx log:

2023/02/18 11:04:27 [error] 159085#0: *63 lua entry thread aborted: runtime error: attempt to yield across C-call boundary

Any ideas of what i might have misconfigured?

Regards

leafo commented 1 year ago

What phase are you making the connection in?

mnegovanovic commented 1 year ago

Hi

error was on my part ... new connection was being invoked from top level require function. After refactoring a bit i was able to fix it.

Regards