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
This fixes the leak, but introduces another problem: the program will not exit cleanly. I couldn't find a good smaller reproduction, but when compiling the node api query engine with cargo build -p query-engine-node-api, copying target/debug/libquery_engine.so to somewhere with a .node ending, and running the following script:
constengine=require('./libquery_engine.so.node');asyncfunctionmain(){constdatamodel=` datasource db { provider = "postgres" url = "postgresql://postgres:prisma@localhost:5432/" } generator js { provider = "prisma-client-js" } model Test { id Int @id field String? } `;constconn=newengine.QueryEngine({datamodel: datamodel,logLevel: "debug",logQueries: true,configDir: "."},(_err,log)=>{console.log(log);});awaitconn.connect();constquery={query: `mutation { queryRaw(query: "SELECT 1") }`,variables: {},};console.log(conn.query(JSON.stringify(query),"{}"));awaitconn.disconnect();}main()
We see the program never exiting. Is it correct to remove the unref? And if so, is there a way to get a program to exit normally?
The text was updated successfully, but these errors were encountered:
Hey, so while debugging this issue, I found out the way to cut the memory leak was to not unref the threadsafe function:
https://github.com/prisma/prisma-engines/pull/2196/files
This fixes the leak, but introduces another problem: the program will not exit cleanly. I couldn't find a good smaller reproduction, but when compiling the node api query engine with
cargo build -p query-engine-node-api
, copyingtarget/debug/libquery_engine.so
to somewhere with a.node
ending, and running the following script:We see the program never exiting. Is it correct to remove the
unref
? And if so, is there a way to get a program to exit normally?The text was updated successfully, but these errors were encountered: