-
Notifications
You must be signed in to change notification settings - Fork 7
Make cached read asynchronous #11
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
base: master
Are you sure you want to change the base?
Conversation
cc @flumedb |
I was talking to Andre about this and a better way would be to use looper. See ssbc/async-append-only-log#3 |
@arj03 It sounds like you are concerned about performance. I am unable to further test/develop for this issue now, as I don't have any known-crashing flumelog+index states. I am running most of my ssb-servers with this patch applied now so am unlikely to encounter the issue any time soon. Even unpatched, I would only see this issue very infrequently. I encourage you to consider merging this patch, as it fixes a bug causing a crash that leaves users stranded if they don't know how to open a GitHub issue or re-sync their db. While the crash is infrequent, it has been reported by multiple people (ssbc/patchwork#1320), and I think we can assume there are more unreported cases. |
What do you think @staltz |
I think fixing the crash is a priority, then we can figure out a more performant way of doing it in a separate PR. It may turn out that our solution to performance is just migrating to jitdb etc. |
I ran bench.js with and without the patch, seems the hit is pretty significant:
|
So approx. 50% slower. Now depending on who you ask, 50% slower might be considered as bad as an occasional crash. Or not. Tricky to arbitrate. |
Thinking a bit more about this, I would probably do this:
|
Make
read
always asynchronous, even if cached, to avoid stack growth in applications that recurse through calling read.As explained in #10