pouchdb: destroy() race condition causing IndexedDB to hang
Still haven’t tracked this down, but opening up an issue so it doesn’t fall through the cracks.
I’ve managed to get IndexedDB in a state where it just doesn’t respond in Chrome after a few tests. Seems to be related to stale: update_after
in map/reduce causing some parallelism. Weirdly, the tests complete when the Dev Tools are open, so we may have another Heiseinbug on our hands.
https://github.com/pouchdb/pouchdb/pull/3414 does not fix this particular bug.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 60 (36 by maintainers)
Commits related to this issue
- (#3415) - Fix intermittent test — committed to pouchdb/pouchdb by daleharvey 9 years ago
- (#3415) - try to repro and fail — committed to pouchdb/pouchdb by nolanlawson 9 years ago
- (#3415) - open idb transactions safely — committed to pouchdb/pouchdb by nolanlawson 9 years ago
- (#3415) - open idb transactions safely — committed to pouchdb/pouchdb by nolanlawson 9 years ago
- (#3415) - open idb transactions safely — committed to pouchdb/pouchdb by nolanlawson 9 years ago
- (#3415) - try again to repro and fail — committed to pouchdb/pouchdb by nolanlawson 9 years ago
- (#3415) - try a dummy transaction — committed to pouchdb/pouchdb by nolanlawson 9 years ago
- (#3415) - Fix hang in leveldb — committed to pouchdb/pouchdb by daleharvey 8 years ago
- (#3415) - Fix hang in leveldb — committed to pouchdb/pouchdb by daleharvey 8 years ago
- (#3415) - Fix hang in leveldb — committed to pouchdb/pouchdb by daleharvey 8 years ago
I am still having the same problem with this code
db.destroy().then(function (){ db = new PouchDB('test'); db.put(...); });
It is reproducible in chrome browser each time when local db is cleared manually and recreate data during sync.
DOMException: Failed to execute ‘transaction’ on ‘IDBDatabase’: The database connection is closing. at openTransactionSafely (…) at allDocsQuery (…) at allDocs (…) at idbAllDocs (…) at PouchDB.idb_allDocs [as _allDocs] (…) at PouchDB.<anonymous> (…) at PouchDB.<anonymous> (…) at PouchDB.<anonymous> (…) at … at new Promise (<anonymous>)
i got this error today as well in Google Chrome Version 57.0.2987.133 (64-bit). clicking “clear site data” in dev tools “application” tab with Indexed DB checked didn’t fix. had to also restart chrome. so at least in that one case, both were needed.
just happened again. this time, i tried clicking “clear site data” in dev tools “application” tab with Indexed DB checked, closing the TAB, reopening the tab, and that fixed it.
i’m facing the same issue when i destroy the database and on complete, immediately recreate a database with the same name.
This happens to me all the time when I clear storage, then recreate databases and then start syncing. I then have to restart the browser to get it working once, before the error happens again after clearing storage.
Using:
I am doing this a lot in dev. I see that this is not going to happen exactly same in production. But when users log out then log back in it could happen too, I guess. Not having a good feeling about it 😦
We’ve seen it using IndexedDB via localForage, not in person but we get the error logs crop up from time to time in Sentry.