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

Write operations hanging on systems with low disk space #78

Closed
grahamkennery opened this issue Mar 19, 2015 · 13 comments
Closed

Write operations hanging on systems with low disk space #78

grahamkennery opened this issue Mar 19, 2015 · 13 comments

Comments

@grahamkennery
Copy link

Seems like I'm failing to get callbacks when trying to add/put data during a transactions when a user's disk space is low. Trying to dig into the problem right now, all of my operations have corresponding .catch() callbacks and none are getting called for any reason.

So far, reproduced on OS X with disk space < 2GB

When Dexie gets into this, "hanging" state, no operations within the transaction will callback - reads or writes.

@grahamkennery
Copy link
Author

After a little bit of digging, here is what I've found so far:

  1. The actual .add() operations are calling back to their respective .then() functions.
  2. The transaction's .then() function is NEVER called.
  3. If I comment out my .add() operations life is grand; the transaction will complete.
  4. Not a single .catch() function is being called, every operation within the transaction (and the transaction itself) has a .catch() function attached to it.

@dfahlander
Copy link
Collaborator

Thanks for your findings so far. It would be important to know whether this is a Dexie or browser problem. Would you have a chance to test it on chrome and/or firefox on your system to know for sure it's not a Safari issue?

@grahamkennery
Copy link
Author

Actually, it would have been nice of me to note that this is in a Chrome App ;-)

I'm currently trying to get the Dexie unit tests running inside the Chrome App - I'll let you know what I find.

@grahamkennery
Copy link
Author

Alright - unit tests on the full Mac refuse to run in the Chrome App. Getting stuck on extendability:recursive-pause.

Tried running just the "transaction" module - hangs on the first test: transaction: empty transaction block.

Windows box with lots of space, all tests pass fine in the Chrome app except for WebWorker because Chrome apps are sandboxed and cannot eval - no worries on that one.

@dfahlander
Copy link
Collaborator

What version of Chrome on the Mac?

@grahamkennery
Copy link
Author

41.0.2272.89

@dfahlander
Copy link
Collaborator

Ok so it's new then. Just wondering what could be the differences between your mac- and windows- Chrome since they behave differently.

@grahamkennery
Copy link
Author

Well - the problem only happens on the mac when it's disk space is hella low - I'm going to give the unit tests a go with more available disk space and see if they run fine. Might not get to that until tomorrow though.

@grahamkennery
Copy link
Author

Alright - so... Operating system doesn't seem to affect test results - the variable here is low disk space. Any write operation inside of a Dexie transaction causes it to never call through to the appropriate .then() callback.

Here's the breakdown of what I ran: (It's also worth noting I've seen the bug manifest in Yosemite on two other machines... I just don't have those machines to test with)

Test environment 1

Windows 8
Chrome 42 - Stable
Dexie Version 1.0.4
Low disk space on C:\ (<1GB)

Running tests a Chrome App Window: Fail
Unit tests refuse to run, hang on any test with a write operation

Running tests in browser tab: Success
All unit tests passed

Test environment 2

Mac OS X 10.8.5
Chrome 42 - Stable
Dexie Version 1.0.4
Low disk space on / (<1GB)

Running tests a Chrome App Window: Fail
Unit tests refuse to run, hang on any test with a write operation

Running tests in browser tab: Success
All unit tests passed

Test environment 3

Windows 8
Chrome 42 - Stable
Dexie Version 1.0.4
Lots of available disk space on C:\ (~3.4GB)

Running tests a Chrome App Window: Success
All unit tests passed - except running Dexie from Web Worker (Known chrome app restriction)

Running tests in browser tab: Success
All unit tests passed

Test environment 4

Mac OS X 10.8.5
Chrome 42 - Stable
Dexie Version 1.0.4
Lots of available disk space on / (~4GB)

Running tests a Chrome App Window: Success
All unit tests passed - except running Dexie from Web Worker (Known chrome app restriction)

Running tests in browser tab: Success
All unit tests passed

@grahamkennery
Copy link
Author

Any chance you can email me? My company is looking to ship a product and this is the source of one of very few remaining known bugs. Trying to get this out the door as soon as possible! graham@kennery.com

@dfahlander
Copy link
Collaborator

I would suggest you to put a break-point or console.log on Dexie.js line 1272 (directly after the line idbtrans.onerror = function (e) {. If you don't come there at all, the problem lies in Chrome, not in Dexie.

@dfahlander
Copy link
Collaborator

Issue seems to be a chromium issue since the onerror callback never gets fired when running in chrome app with low available disk space. Discussing having some kind of workaround in Dexie such as a configurable timeout for transactions. But the issue really needs to be solved in Chrome.

@dfahlander
Copy link
Collaborator

A customer found that the abort event was actually fired on the transaction in this situation, but not the error event. This is good news because then we could work around the issue by ensuring the error event will be explicitely called when abort error happens.

dfahlander added a commit that referenced this issue Sep 22, 2015
Issue #78 happens on chrome devices with low disk space -
transaction.onerror is never called, only transaction.onabort. A
workaround in Dexie is therefore to always make sure the returned
Promise will fail whenever an onabort occurs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants