You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Intermittent failure in /XMLHttpRequest/event-timeout.htm #3396
A-content/domInteracting with the DOM from web contentB-high-valueRepresents work that would have a big impactB-interesting-projectRepresents work that is expected to be interesting in some fashionC-assignedThere is someone working on resolving the issueE-more-complexVariable effort required; may require a mentor. Recommended solution is clearly described in the issI-intermittentProblem reproduces intermittently.I-wrongAn incorrect behaviour is observed.
This one's fun - the test sets a 5ms timeout on the XHR, and calls setTimeout with a delay of 10ms. The test asserts that the setTimeout is never reached, because the ontimeout handler ends the test. Our timer implementation is messy, in that both the XHR and setTimeout timers have their own tasks which send a message to the script task when they expire. That means that scheduling-wise we have no guarantees that lower timer values will expire and notify the script task before the timers with higher values.
changed the title [-]Intermittent timeout in /XMLHttpRequest/event-timeout.htm[/-][+]Intermittent failure in /XMLHttpRequest/event-timeout.htm[/+]on Nov 12, 2014
create a new timer thread that controls all timers for a constellation
internally, it has an event loop that selects on two input receivers
one watches for messages that add/remove a timer
the other is a timer that waits until the next web content timer should fire
when a timer is added:
store its creation time and expiry time in a vector sorted by expiry date
if the new timer is in the head position (ie. it will expire soonest), reset the event loop timer to the new timer's expiration time
when a timer is removed:
remove it from the sorted vector
if the new timer is in the head position (ie. it will expire soonest), reset the event loop timer to the new head timer's expiration time, or the maximum timer value if there is none
when the event loop timer fires:
for stored each timer that has an expiry time earlier than the current time
send a message to the script task associated with the expired timer in the sorted vector
run the steps for removing a timer
if the timer should repeat, add it to the sorted vector and run the steps for adding a timer
compositing doesn't depend on the script crate, it depends on script_traits instead. Why does constellation.rs need something from the timers module? Can that something move into the script_traits crate instead?
Alright, so I will move all the new timer code into script_traits::timer.rs? So that the Constellation can hold the sender to the thread, and pass it to newly created ScriptTasks.
I don't believe all of the code needs to move. You might be able to just move the TimerRequest enum to script_traits, if that's all that the Constellation code needs to reference.
According to the conversation at the bottom of master...pgonda:timeout-event-loop-thread you are welcome to tackle this, @benschulz. You should definitely at least look through the prior art there, if not steal it entirely :)
A-content/domInteracting with the DOM from web contentB-high-valueRepresents work that would have a big impactB-interesting-projectRepresents work that is expected to be interesting in some fashionC-assignedThere is someone working on resolving the issueE-more-complexVariable effort required; may require a mentor. Recommended solution is clearly described in the issI-intermittentProblem reproduces intermittently.I-wrongAn incorrect behaviour is observed.
Activity
jdm commentedon Sep 17, 2014
Maybe we need a timer task that accepts requests for new timers along with a closure to run when it expires?
Manishearth commentedon Sep 18, 2014
Note: this line might be a part of the issue, however
send_optis non blocking so I don't think it should be.The timer task seems like a good idea.
jdm commentedon Sep 18, 2014
I did rearrange the lines in the SpiderMonkey upgrade branch and I still saw the failure regularly when the system was under load.
[-]Intermittent timeout in /XMLHttpRequest/event-timeout.htm[/-][+]Intermittent failure in /XMLHttpRequest/event-timeout.htm[/+]jdm commentedon Nov 12, 2014
Disable event-timeout for rustc upgrade. See #3396.
Manishearth commentedon Nov 13, 2014
Apparently this is now a constant failure on the mac builders (but not on a normal mac), post-upgrade.
I asked @glennw to disable it for now, but we should look into this again.
New commits added.
New commits added.
jdm commentedon Feb 23, 2015
Here's how I want to go about fixing this:
10 remaining items
Manishearth commentedon May 28, 2015
extern crate timerswon't work, you want touse timers(from within script) oruse script::timersfrom a different crate.extern crate scriptwill only work in the compositinglib.rsHowever, it might be worth keeping the dependency separate by moving this to
script_traits(I'm not sure what you need to use in
constellation.rs)working on servo#3396, stuck using script::timers
pgonda commentedon May 28, 2015
Thanks!! That works for the
servo/lib.rsbut I am still working on thecompositing/constellation.rsknow anyone that would be able to help?jdm commentedon May 28, 2015
compositing doesn't depend on the script crate, it depends on script_traits instead. Why does constellation.rs need something from the timers module? Can that something move into the script_traits crate instead?
pgonda commentedon Jun 2, 2015
Alright, so I will move all the new timer code into
script_traits::timer.rs? So that theConstellationcan hold the sender to the thread, and pass it to newly created ScriptTasks.jdm commentedon Jun 2, 2015
I don't believe all of the code needs to move. You might be able to just move the TimerRequest enum to script_traits, if that's all that the Constellation code needs to reference.
benschulz commentedon Aug 28, 2015
Are you still working on this, @pgonda? If not, I'd like to try my hand at it.
jdm commentedon Aug 28, 2015
According to the conversation at the bottom of master...pgonda:timeout-event-loop-thread you are welcome to tackle this, @benschulz. You should definitely at least look through the prior art there, if not steal it entirely :)
Auto merge of #7450 - benschulz:constellation-timer, r=jdm
Auto merge of #7450 - benschulz:constellation-timer, r=jdm
XHR timeouts use same abstraction as scripts timers. (fixes servo#3396)
XHR timeouts use same abstraction as scripts timers. (fixes servo#3396)
Auto merge of #8168 - benschulz:xhr-timeout-ordering, r=jdm