crossbario / zlmdb

Object-relational in-memory database layer based on LMDB
https://crossbar.io/
MIT License
29 stars 10 forks source link

Improve database context manager robustness #53

Open oberstet opened 2 years ago

oberstet commented 2 years ago

See https://github.com/crossbario/crossbar/issues/2011

We should handle:

in

https://github.com/crossbario/zlmdb/blob/2ebd65a51e0ba48fb72a354bbb72591d3d27d8e4/zlmdb/_database.py#L337

oberstet commented 2 years ago

adding a more or less clever microsleep and auto-retry: one problem is, the context manager isn't an asynch context manager, and hence any "microsleep" will need to run synchronously. we should be good with a micro (=very short) sleep though, and hence forcing sync should not bother the app much ..

oberstet commented 2 years ago

alright, this change should improve the situation https://github.com/crossbario/zlmdb/commit/c952f420212e5bea33690f2678fa161d920fc580

I'll leave this issue open for now .. as an anchor until we have more feedback in using the new code