Closed Bug 919535 Opened 11 years ago Closed 11 years ago

Closing Sqlite.jsm databases should block profileBeforeChange

Categories

(Toolkit :: Storage, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: Yoric, Assigned: gps)

References

Details

(Whiteboard: [Async][Async Shutdown])

Attachments

(1 file)

Since Sqlite.jsm calls asyncClose, the actual closing could theoretically take place after profile-before-change, which is bad. We need to plug these calls to asyncClose to AsyncShutdown.profileBeforeChange.

This will cause shutdown freezes (or 100% reproducible shutdown crashes once bug 917764 has landed) if the owner of the database calls asyncClose too late, which is certainly better than silent data loss/corruption.
Whiteboard: [Async][Async Shutdown]
Gps could you handle this?
Flags: needinfo?(gps)
I think this will do it! Not sure how to test this explicitly...
Attachment #813076 - Flags: review?(dteller)
Assignee: nobody → gps
Comment on attachment 813076 [details] [diff] [review]
Use AsyncShutdown in Sqlite.jsm

Review of attachment 813076 [details] [diff] [review]:
-----------------------------------------------------------------

That looks good to me.
I would be slightly more comfortable if that part of the code were written with Task.jsm and we had a try/finally to ensure that we always resolve/reject the promise.
What do you think?
Attachment #813076 - Flags: review?(dteller)
Comment on attachment 813076 [details] [diff] [review]
Use AsyncShutdown in Sqlite.jsm

(In reply to David Rajchenbach Teller [:Yoric] from comment #3)
> That looks good to me.
> I would be slightly more comfortable if that part of the code were written
> with Task.jsm and we had a try/finally to ensure that we always
> resolve/reject the promise.
> What do you think?

I think the current patch accomplishes what we set out to accomplish in a very simple way and any extra code cleanup should be deferred to a followup bug.
Attachment #813076 - Flags: review?(dteller)
Comment on attachment 813076 [details] [diff] [review]
Use AsyncShutdown in Sqlite.jsm

Review of attachment 813076 [details] [diff] [review]:
-----------------------------------------------------------------

Ok, I won't insist.
Attachment #813076 - Flags: review?(dteller) → review+
Flags: needinfo?(gps)
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/a5046a3a30ea
Keywords: checkin-needed
Whiteboard: [Async][Async Shutdown] → [Async][Async Shutdown][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/a5046a3a30ea
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [Async][Async Shutdown][fixed-in-fx-team] → [Async][Async Shutdown]
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: