Closed Bug 1168166 Opened 7 years ago Closed 7 years ago

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

Categories

(Core :: Storage: IndexedDB, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox39 --- unaffected
firefox40 --- affected
firefox41 --- fixed

People

(Reporter: bkelly, Assigned: bent.mozilla)

Details

Attachments

(1 file)

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.
Ben, did you intend this behavior?
Flags: needinfo?(bent.mozilla)
Hm, no, that looks bad.
Flags: needinfo?(bent.mozilla)
Attached patch Trivial fixSplinter Review
Assignee: nobody → bent.mozilla
Status: NEW → ASSIGNED
Attachment #8616788 - Flags: review?(Jan.Varga)
Attachment #8616788 - Flags: review?(Jan.Varga) → review+
This should get backported to aurora.
https://hg.mozilla.org/mozilla-central/rev/ab4fcd2c9ca6
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.