Closed Bug 551572 Opened 14 years ago Closed 14 years ago

100% CPU when sitting on merge-choice screen

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: Mardak, Assigned: mconnor)

Details

Attachments

(1 file, 2 obsolete files)

If the user doesn't pick a sync direction and/or restarts, Weave will keep trying to sync and fail continuously.
Target Milestone: --- → 1.3
Attached patch v1 (obsolete) — Splinter Review
Bah.
Assignee: nobody → mconnor
Status: NEW → ASSIGNED
Attachment #436123 - Flags: review?(mconnor)
Attachment #436123 - Flags: review?(mconnor) → review?(edilee)
Comment on attachment 436123 [details] [diff] [review]
v1

>+++ b/source/modules/service.js
>         default:
>+          this.nextSync = 0;
>           this._scheduleNextSync();
So this will schedule the next sync to be probably 24 hours from now? Why was this sync getting triggered in the first place and not just waiting for the merge type to get picked? Auto-connected after restart without picking a merge? Sync scheduled because we do a connect before getting to the merge screen?
Attached patch v2 - better (obsolete) — Splinter Review
* Don't schedule more syncs, and log the abort.
* Treat this state as a "needs setup" case and show the "Set Up Weave..." statusbar message.
Attachment #436123 - Attachment is obsolete: true
Attachment #437213 - Flags: review?(edilee)
Attachment #436123 - Flags: review?(edilee)
Flags: blocking-weave1.3+
Whiteboard: [has patch][needs review Mardak]
Comment on attachment 437213 [details] [diff] [review]
v2 - better

>+++ b/source/chrome/content/sync.js
>+    let notSetup = errors.indexOf(Weave.Status.login) != -1;
Could this be called loginError or something else? notSetup sounds kinda weird and isn't quite what the RHS is.

>+++ b/source/modules/service.js
>       switch(Svc.Prefs.get("firstSync")) {
>         default:
>-          this._scheduleNextSync();
>+          this._log.debug("sync() called before setup complete, exiting");
>           return;
That works, but we should probably have _checkSync() return a don't-sync reason if pref("firstSync") == "notReady". So syncs won't get scheduled and a normal sync won't run either.
* moves the check to _checkSync
* moves _checkSync to be up front, as we should do nothing if this check fails
* moves cluster check to be after checkSync, but before firstSync handling, so we don't wipe local before we know we're syncing etc...
* changes variable to loginError per comments
Attachment #437213 - Attachment is obsolete: true
Attachment #437749 - Flags: review?(edilee)
Attachment #437213 - Flags: review?(edilee)
Comment on attachment 437749 [details] [diff] [review]
v3 - the bettering

(In reply to comment #5)
> * moves cluster check to be after checkSync, but before firstSync handling, so
> we don't wipe local before we know we're syncing etc...
I don't see how this fixes the wipe local stuff. remoteSetup still happens after firstSync stuff. But this can be done in the other bug. Basically I think we want get("firstSync") == "wipeRemote" before remoteSetup and get("firstSync") == "wipeClient" after remoteSetup.
Attachment #437749 - Flags: review?(edilee) → review+
Whiteboard: [has patch][needs review Mardak] → [has patch][has review]
It doesn't fix all of it, but it fixes the "wipelocal happens before you get a node assigned" case, and similar ones.  It's just less-stupid, it doesn't fix the remoteSetup case.  It also means we don't call wipeRemote without having a clusterURL :)
http://hg.mozilla.org/labs/weave/rev/21c361d9d799
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [has patch][has review]
Target Milestone: 1.3 → 1.3b1
verified with 1.3b5
Status: RESOLVED → VERIFIED
Component: Firefox Sync: UI → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: