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

Fix indexedDb driver so pending operations are resolved under concurrent worker threads #1019

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

inf3rnus
Copy link

@inf3rnus inf3rnus commented Apr 7, 2021

Hi, this is related to:

#1008

and

#1009

I am unfortunately unable to run tests against this locally, because the tests appear to be broken per the Issues board (I gave it my best shot, but I don't want to spend too much time on that if they're broken, we should also update the README to reflect they're broken at the moment if they're truly broken), so I'm hoping one of the long time maintainers can look at this and confirm this makes sense.

What this fixes is a race condition that can pop up in the indexedDb driver where operations may never complete when a new connection is setup for the exact same store. So e.g. if you construct two instances for the same storeName and version and they are created concurrently (with a worker thread and ur main thread) and both of those instances make pending requests, you can run into a situation where promises hang in the event loop.

So e.g calls such as getItem() never resolve. So yeah, generally not good. Any insight/a look over would be greatly appreciated.

Thanks for all the hard work people!

Best,
inF3Rnus

@inf3rnus inf3rnus changed the title Fix indexDb driver so pending operations are resolved under concurrent worker threads Fix indexedDb driver so pending operations are resolved under concurrent worker threads Apr 7, 2021
@brettr91
Copy link

brettr91 commented Nov 14, 2022

Hi inf3rnus,

I was having the same issue, and your fix resolved the issue.

But it seems to have created a new issue.

Error: No available storage method found.
at driverPromiseLoop

I'll keep looking into this issue.

Thank you very much!

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

Successfully merging this pull request may close these issues.

None yet

2 participants