Closed
Bug 1107329
Opened 10 years ago
Closed 10 years ago
Attach stacks to settings locks and add error for long lock waits
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: qdot, Assigned: gerard-majax)
References
Details
Attachments
(2 files, 1 obsolete file)
525.34 KB,
image/png
|
Details | |
12.39 KB,
patch
|
gerard-majax
:
review+
|
Details | Diff | Splinter Review |
Settings locks should have their creation function stack attached to them (just create a new Error object at get a stack from it), and we should warn in logs when a settings lock is being held too long and may be blocking the rest of the system.
Assignee | ||
Comment 1•10 years ago
|
||
Now that settings should be less messy, let's fix this to help diagnose further issues.
Assignee | ||
Updated•10 years ago
|
Assignee: kyle → lissyx+mozillians
Assignee | ||
Comment 2•10 years ago
|
||
I think we should be doing all of this on SettingsRequestManager's side:
- because it lives in the parent process,
- because it's here that the lockup will happen,
- becaues it's used by both SettingsManager and SettingsService
The stack should be dumped in the createLock() implementation on SettingsManager/SettingsService lock, and passed with the Settings:CreateLock message.
Assignee | ||
Comment 3•10 years ago
|
||
Assignee | ||
Comment 4•10 years ago
|
||
To help diagnosing further issues with the Settings API getting blocked,
we add some tracking of the tasks and locks queue vivacity. We ensure to
keep track of the last lock id at the head of the queue, and we verify
whether it does not stays on top of it for too long.
Assignee | ||
Comment 5•10 years ago
|
||
Assignee | ||
Comment 6•10 years ago
|
||
Comment on attachment 8540685 [details] [diff] [review]
Adding locks tasks queue vivacity checking r=qdot
Screenshot was taken with the fix from bug 1110872 removed, in a mulet running oop, and with an app doing mozSettings use while reloading the page.
Attachment #8540685 -
Flags: review?(kyle)
Reporter | ||
Comment 7•10 years ago
|
||
Comment on attachment 8540685 [details] [diff] [review]
Adding locks tasks queue vivacity checking r=qdot
Review of attachment 8540685 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM, r+'ing now. I think we could check for lockup more frequently without issue, but that's not blocking this from landing.
::: dom/settings/SettingsRequestManager.jsm
@@ +1123,4 @@
> break;
> case "Settings:Get":
> if (VERBOSE) debug("Received getRequest from " + msg.lockID);
> + this.checkSoftLockup();
Why not just check any time we receive any message? It looks like a fairly quick procedure.
Attachment #8540685 -
Flags: review?(kyle) → review+
Assignee | ||
Comment 8•10 years ago
|
||
(In reply to Kyle Machulis [:kmachulis] [:qdot] (USE NEEDINFO?) from comment #7)
> Comment on attachment 8540685 [details] [diff] [review]
> Adding locks tasks queue vivacity checking r=qdot
>
> Review of attachment 8540685 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> LGTM, r+'ing now. I think we could check for lockup more frequently without
> issue, but that's not blocking this from landing.
>
> ::: dom/settings/SettingsRequestManager.jsm
> @@ +1123,4 @@
> > break;
> > case "Settings:Get":
> > if (VERBOSE) debug("Received getRequest from " + msg.lockID);
> > + this.checkSoftLockup();
>
> Why not just check any time we receive any message? It looks like a fairly
> quick procedure.
I was not sure it would be useful to do it for anything else than Get/Set/Clear
Assignee | ||
Comment 9•10 years ago
|
||
To help diagnosing further issues with the Settings API getting blocked,
we add some tracking of the tasks and locks queue vivacity. We ensure to
keep track of the last lock id at the head of the queue, and we verify
whether it does not stays on top of it for too long.
Assignee | ||
Updated•10 years ago
|
Attachment #8540685 -
Attachment is obsolete: true
Assignee | ||
Comment 10•10 years ago
|
||
Comment on attachment 8541153 [details] [diff] [review]
Adding locks tasks queue vivacity checking r=qdot
Carrying r+ from :qdot
Attachment #8541153 -
Flags: review+
Assignee | ||
Comment 11•10 years ago
|
||
(In reply to Alexandre LISSY :gerard-majax from comment #10)
> Comment on attachment 8541153 [details] [diff] [review]
> Adding locks tasks queue vivacity checking r=qdot
>
> Carrying r+ from :qdot
Try: https://tbpl.mozilla.org/?tree=Try&rev=4a50ed28c45e
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 12•10 years ago
|
||
Keywords: checkin-needed
Comment 13•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Did anyone investigate performance differences with and without this patch? In the not too distant past I thought getting a stack like this was slow...
Flags: needinfo?(lissyx+mozillians)
Flags: needinfo?(kyle)
Assignee | ||
Comment 15•10 years ago
|
||
(In reply to ben turner [:bent] (use the needinfo? flag!) from comment #14)
> Did anyone investigate performance differences with and without this patch?
> In the not too distant past I thought getting a stack like this was slow...
Nothing formal, but I have not noticed this as having a huge impact as a dogfood user of some slow devices. Also, the cost is at createLock() only.
If we get figures that shows it has a non neglictible impact, we may limit the stack itself under a pref.
Flags: needinfo?(lissyx+mozillians)
Updated•10 years ago
|
Flags: needinfo?(kyle)
You need to log in
before you can comment on or make changes to this bug.
Description
•