Closed Bug 871872 Opened 12 years ago Closed 12 years ago

Clean up ContactDB temporary cache if the child dies without asking for more contacts.

Categories

(Core :: DOM: Device Interfaces, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: reuben, Assigned: reuben)

References

Details

(Whiteboard: [fixed-in-birch])

Attachments

(1 file, 2 obsolete files)

Right now if the child receives a chunk and doesn't use it or call continue() again, we keep the dispatcher around in the parent. We should clean that up when the child dies.
So because we moved to using DOMRequestIpcHelper for cursors in bug 862351, we don't have a list of cursors in the child anymore, and that's the reason for the DOMRequestHelper.jsm changes here. I could also keep that list in ContactManager, if that's preferred.
Attachment #749151 - Flags: review?(anygregor)
Hm no we should just fix this in the case "child-process-shutdown" call. Calling cleanup from the child when the child just crashed doesn't work :)
Attachment #749151 - Attachment is obsolete: true
Attachment #749151 - Flags: review?(anygregor)
Tested manually on the device, since we have leakcheck disabled in B2G tests.
Attachment #751272 - Flags: review?(anygregor)
I would prefer if we don't have to queue up all cursorIDs until we shut down the app. How about moving the successCallback of sendNow into ContactsService and do a proper cursorID deletion when we are done with a cursor?
As discussed on IRC.
Attachment #751272 - Attachment is obsolete: true
Attachment #751272 - Flags: review?(anygregor)
Attachment #751925 - Flags: review?(anygregor)
Comment on attachment 751925 [details] [diff] [review] Clean up existing cursors on child process shutdown Review of attachment 751925 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/contacts/fallback/ContactService.jsm @@ +111,5 @@ > try { > mm.sendAsyncMessage("Contacts:GetAll:Next", {cursorId: msg.cursorId, contacts: aContacts}); > + if (aContacts === null) { > + let index = this._cursors[mm].indexOf(msg.cursorId); > + this._cursors[mm].splice(msg.cursorId, 1); that doesn't work.
Sigh, pretend that's splice(index, 1), I attached the patch from the wrong tree.
Comment on attachment 751925 [details] [diff] [review] Clean up existing cursors on child process shutdown Review of attachment 751925 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/contacts/fallback/ContactDB.jsm @@ +693,5 @@ > } > }, > > + clearDispatcher: function CDB_clearDispatcher(aCursorId) { > + debug("clearDispatcher: " + aCursorId); if (DEBUG) .... ::: dom/contacts/tests/test_contacts_getall.html @@ +444,5 @@ > + } else { > + ok(true, "All done!\n"); > + SimpleTest.finish(); > + } > +} Please don't change this.
Attachment #751925 - Flags: review?(anygregor) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: