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

Deadlock (?) after switching to 2.7.0 #203

Closed
ppedziwiatr opened this issue Nov 21, 2022 · 10 comments
Closed

Deadlock (?) after switching to 2.7.0 #203

ppedziwiatr opened this issue Nov 21, 2022 · 10 comments

Comments

@ppedziwiatr
Copy link

Hey,

my application seems to hang completely after switching to lmdb-js version 2.7.0.

Version 2.6.9 works properly. No other changes have been made.

Do you have any idea what might be causing the issues?

@kriszyp
Copy link
Owner

kriszyp commented Nov 21, 2022

There were some changes to how locks are used to wait for transactions to be flushed to disk (seems likely related to this), but I am not sure how it would actually end up in a deadlock. Do you have any suggestions for how I could reproduce this?

@ppedziwiatr
Copy link
Author

Hey, I will try to prepare some MRE, just need some time to sort out my own stuff ;-)

@kriszyp
Copy link
Owner

kriszyp commented Nov 21, 2022

Ok, thanks. And I will do some of our own load testing, and see if I spot anything.

@atomictag
Copy link

I noticed the same problem. If that helps, my setup is lmdb-darwin-x64. Version 2.7.x hangs with a minimal test:

const rootDb = lmdb.open(...) // storage is created on file ok
await rootDb.put("something", "anything");

After I reverted to 2.6.9 I noticed that running the same test on a db created with 2.7.0 would leave the promise unresolved.
Running the same test with 2.6.9 after deleting the db store would work again as usual.

@kriszyp
Copy link
Owner

kriszyp commented Dec 1, 2022

I haven't been able to reproduce this. I did find potential issue with how locks were created on MacOS, and fixed in v2.7.2, if you want to give that a try and see if it happens to make any difference.

@atomictag
Copy link

I just tried 2.7.2 and all my tests pass again without any issues 🎉.
Thank you!

@ppedziwiatr
Copy link
Author

I'm trying to test the 2.7.2 on my M1, unfortunately I'm having this issue while doing yarn install:

error /Users/piotrpedziwiatr/projects/warp-contracts-lmdb/node_modules/lmdb: Command failed.
Exit code: 127
Command: node-gyp-build-optional-packages
Arguments:
Directory: /Users/piotrpedziwiatr/projects/warp-contracts-lmdb/node_modules/lmdb
Output:
env: node\r: No such file or directory

Tested on Node 18.5 and 16.16.

Version 2.7.1 installs normally...

@ppedziwiatr
Copy link
Author

hmm, npm install worked properly, so it's probably sth with yarn...

@kriszyp
Copy link
Owner

kriszyp commented Dec 2, 2022

Ugh, those line ending errors are the worst. Should be fixed with 2.7.3, I hope.

@ppedziwiatr
Copy link
Author

Yup, it's working great, thank you very much :-) deadlock is also fixed on my M1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants