Lightning.NET icon indicating copy to clipboard operation
Lightning.NET copied to clipboard

Possibly surprising result code returned when doing a Put to a full env

Open placrosse opened this issue 1 year ago • 2 comments

Update example code in README to show that a Put to a full env will return a Success value, even though the Commit will fail with Map Full, which may be a surprising outcome (though it does match the underlying lmdb behavior). Or, at a minimum, capture and check the returns from both the Put and Commit.

placrosse avatar Jun 14 '24 03:06 placrosse

In other words, receiving a Success return on a single put, even in a simple single-threaded process, is not a guarantee that the Commit will succeed.

Though this does match what LMDB does directly (as this wrapper is passing through the results), showing result codes captured for only the Get (in the main README example), and not the Put nor its corresonding Commit, may point towards different expected behaviors.

Thank you for your work on this language binding.

placrosse avatar Jun 14 '24 03:06 placrosse

Do you think we should update documentation or the API in this case?

AlgorithmsAreCool avatar Jul 05 '24 03:07 AlgorithmsAreCool

I don't think the readme needs to be any different than it is. It's expected that you understand the underlying API and the docs are linked to in the readme.

CoreyKaylor avatar Jul 09 '24 17:07 CoreyKaylor