IDB should check mozStorageConnection::SetGrowthIncrement() return for NS_ERROR_FILE_TOO_BIG

RESOLVED FIXED in Firefox 41

Status

()

Core
DOM: IndexedDB
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: bkelly, Assigned: Ben Turner (not reading bugmail, use the needinfo flag!))

Tracking

Trunk
mozilla41
Points:
---

Firefox Tracking Flags

(firefox39 unaffected, firefox40 affected, firefox41 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
IndexedDB currently calls mozIStorageConnection::SetGrowthIncrement() to grow the sqlite in larger chunks.  It only does this on desktop, though, because SetGrowthIncrement() is constrainted not to work on mobile.  Looking at the comment for this method, though:

  To conserve memory on systems short on storage space, this function will have no effect on mobile devices or if less than 500MiB of space is left available.

It also fails if the desktop machine has <= 500MiB of disk left.

This means the current IDB code will always error out when the disk hits this threshold.  IDB should probably check for NS_ERROR_FILE_TOO_BIG and ignore it since the growth increment is mainly an optimization.
(Reporter)

Comment 1

3 years ago
Ben, did you intend this behavior?
Flags: needinfo?(bent.mozilla)
Hm, no, that looks bad.
Flags: needinfo?(bent.mozilla)
Created attachment 8616788 [details] [diff] [review]
Trivial fix
Assignee: nobody → bent.mozilla
Status: NEW → ASSIGNED
Attachment #8616788 - Flags: review?(Jan.Varga)

Updated

3 years ago
Attachment #8616788 - Flags: review?(Jan.Varga) → review+
This should get backported to aurora.
status-firefox39: --- → unaffected
status-firefox40: --- → affected
https://hg.mozilla.org/mozilla-central/rev/ab4fcd2c9ca6
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox41: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.