Closed
Bug 1025352
Opened 10 years ago
Closed 10 years ago
Race condition in checkMediaTracks
Categories
(Core :: WebRTC, defect)
Core
WebRTC
Tracking
()
RESOLVED
FIXED
mozilla33
People
(Reporter: drno, Assigned: drno)
Details
Attachments
(1 file, 2 obsolete files)
2.83 KB,
patch
|
Details | Diff | Splinter Review |
Tests can currently pass the checkMediaTracks verification, but still later get terminated by the addStreamTimeout.
Assignee | ||
Comment 1•10 years ago
|
||
Rather then trying to prevent the race condition this patch should make the ok() test in the timeout function succeed in case the media tracks got verified before the timeout handler got setup.
Attachment #8440187 -
Flags: review?(gmealer)
In the original code, var addStreamTimeout = null; function _checkMediaTracks(constraintsRemote, onSuccess) { if (self.addStreamTimeout !== null) { clearTimeout(self.addStreamTimeout); But where the timeout is set... addStreamTimeout = setTimeout(function () { ok(false, self + " checkMediaTracks() timed out waiting for onaddstream event to fire"); ...which modified the var addStreamTimeout at the top. Isn't the problem that we're checking self.addStreamTimeout instead of the var addStreamTimeout you declared? My guess is that the check passes (because undefined !== null) but then we proceed to clearTimeout(undefined) because it's still using self. I suspect we might just need to remove the self. from those two usages in _checkMediaTracks().
Assignee | ||
Comment 3•10 years ago
|
||
(In reply to Geo Mealer [:geo] from comment #2) > Isn't the problem that we're checking self.addStreamTimeout instead of the > var addStreamTimeout you declared? > > My guess is that the check passes (because undefined !== null) but then we > proceed to clearTimeout(undefined) because it's still using self. > > I suspect we might just need to remove the self. from those two usages in > _checkMediaTracks(). You are absolutely right. Thanks for catching that! New patch coming...
Assignee | ||
Comment 4•10 years ago
|
||
This patch fixes a couple of issues around the checkMediaTracks timeout.
Attachment #8440187 -
Attachment is obsolete: true
Attachment #8440187 -
Flags: review?(gmealer)
Attachment #8440878 -
Flags: review?(gmealer)
Comment on attachment 8440878 [details] [diff] [review] bug_1025352_fix_checkMediaTracks_race_condition.patch Review of attachment 8440878 [details] [diff] [review]: ----------------------------------------------------------------- Looks fine. The logic around onAddStreamFired is starting to get a little complex, though, and you have a lot commented with a "TODO: Remove..." making me wonder how much we want to lean on the flag. r+, but something we might want to think about refactoring a bit.
Attachment #8440878 -
Flags: review?(gmealer) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 6•10 years ago
|
||
Can you please run this through Try and post a link to the results? Thanks :)
Keywords: checkin-needed
Assignee | ||
Comment 7•10 years ago
|
||
Updated against latest m-c. Carrying forward r+=geo I thought this is low risk enough to have only try it locally, but it looks like I'm getting too lazy ;-) Try run: https://tbpl.mozilla.org/?tree=Try&rev=022ead66723d
Attachment #8440878 -
Attachment is obsolete: true
Assignee | ||
Comment 8•10 years ago
|
||
I don't see any new problems in the test run :-)
Keywords: checkin-needed
Comment 9•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/3be598cf0653
Keywords: checkin-needed
Comment 10•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3be598cf0653
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in
before you can comment on or make changes to this bug.
Description
•