Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support lmdb-js #23268

Open
alexgleason opened this issue Apr 7, 2024 · 5 comments
Open

Support lmdb-js #23268

alexgleason opened this issue Apr 7, 2024 · 5 comments
Labels
bug Something isn't working correctly node compat node native extension related to the node-api (.node)

Comments

@alexgleason
Copy link
Contributor

I'm building an application in Deno that uses lmdb-js, and we hit a snag where asyncronous transactions don't work on Deno, which we believe is due to this issue (from the lmdb-js README):

Note that Deno and Bun's support for NAPI is not very stable yet, and currently asynchronous transactions (transaction method) are not supported (Bun issue oven-sh/bun#158 (comment)).

From what we can tell, the "Asynchronous thread-safe function calls" family of functions is not implemented, and may be what's causing this:

image

Having Deno + LMDB would be a big win for us. And I believe there's unexplored potential with Deno KV as well (eg creating a wrapper for lmdb-js that implements the Deno.KV interface kriszyp/lmdb-js#236)

cc @kriszyp @xyzshantaram

@bartlomieju
Copy link
Member

Do you have a specific error that is raised? From what I can see we do implement these APIs.

@bartlomieju bartlomieju added needs info needs further information to be properly triaged node compat node native extension related to the node-api (.node) labels Apr 7, 2024
@kriszyp
Copy link

kriszyp commented Apr 8, 2024

If I recall correctly, the issue is that https://github.com/nodejs/node-addon-api calls napi_release_threadsafe_function, which is supposed to trigger the thread_finalize_cb, but it does not happen. So there is no error that is raised, it is absence of calling the callback that is problem (so a program that is waiting for that callback just hangs).

@alexgleason
Copy link
Contributor Author

so a program that is waiting for that callback just hangs

This is exactly what we're experiencing.

@bartlomieju
Copy link
Member

Thanks for detailed explanation. @littledivy is this something you could put in your backlog?

@bartlomieju bartlomieju added bug Something isn't working correctly and removed needs info needs further information to be properly triaged labels Apr 8, 2024
@devsnek
Copy link
Member

devsnek commented Jun 10, 2024

I think this should be fixed in #24101. If you have repro code I'd be happy to confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat node native extension related to the node-api (.node)
Projects
None yet
Development

No branches or pull requests

4 participants