Closed atownley closed 9 months ago
The stack trace you posted suggests that this error is happening when a thread is terminating. Do you have other threads running in parallel that might have terminated at the same time? This code in question has actually been updated (the napi_get_reference_value call no longer exists) in 2.9, maybe try 2.9.1 and see if the error persists?
Hey. Thanks for the quick reply.
No other threads as part of the way I run the unit tests.
I'll try the upgrade and see what happens. Thus far, I'm running it in a test environment with the changes. I'm not stressing it, but it hasn't exhibited the same behavior.
Hopefully, the upgrade will fix it.
I'll let you know, but I won't get a chance to mess with it again for a few days.
Cheers,
ast
Yep. 2.9.1 solved the problem. No more crashing. Thanks!
Hi,
Since I got things migrated to lmdb and sorted out the sync vs. async transaction issue, things have been going extremely well. I'm super happy with the performance, the parallel access and everything it says on the tin.
In tracking down an issue today in another area of code, I discovered something that needed to be persisted that I'd missed.
It is a small structure, and I've tried it serialized to JSON manually and without, so this isn't the problem.
The sequence is this inside a utility function that basically increments a counter:
var val = db.get(key); // use initializer db.putSync(key, new value);
And this is also inside a larger synchronous transaction. I'm not doing any asynchronous writes or transactions at all in my code right now.
It's not crazy, and I'm doing hundreds of other reads and writes all the time. And, under current "normal" operations, I don't see the problem.
However, when I run my unit tests, they complete fine, and then I get this:
I'm using lmdb version 2.8.5 on macOS 11.7.10.
Any idea how I can track this further? The only thing I can think is that I'm changing the same key value I read almost immediately, which is something I'm not doing elsewhere.
I'm not really sure what else to isolate, and I've triple-checked everything I can obviously see.
What would you suggest?
Cheers,
ast