Skip to content

Fixed panic in ActiveTimers.set_timeout_or_interval. - #8175

Merged
bors-servo merged 1 commit into
servo:masterfrom
benschulz:set-timeout-panic
Nov 9, 2015
Merged

bors-servo merged 1 commit into
servo:masterfrom
benschulz:set-timeout-panic

Conversation

@benschulz

Copy link
Copy Markdown
Contributor

ActiveTimers.set_timeout_or_interval asserts that the pipeline is not currently frozen. Apparently that is too strict. When pending network requests complete after a pipeline is frozen, scripts may be executed and a timer scheduled.

With these changes scheduling a timer while the pipeline is frozen behaves as if the timer was scheduled at the time the pipeline was frozen.

To reproduce the panic

  1. ./mach run -r http://google.com,
  2. immediately click on any link and
  3. wait for the panic.

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 24, 2015
@Ms2ger

Ms2ger commented Oct 24, 2015

Copy link
Copy Markdown
Contributor

I'm not entirely sure we should execute script after the pipeline is frozen, but I don't really know anything about freezing.

@benschulz

Copy link
Copy Markdown
Contributor Author

I'm not entirely sure we should execute script after the pipeline is frozen

That was my intuitive understanding of freezing as well, hence the assertion. However, now that I've run into the panic — after merging, to my shame — I can't find anything to support that intuition. The documentation for the relevant message says "Notifies script task to suspend all its timers".

@nox nox added A-content/script Related to the script thread I-panic Servo encounters a panic. labels Oct 24, 2015
@jdm

jdm commented Oct 24, 2015

Copy link
Copy Markdown
Member

Our freezing implementation is extremely incomplete, unfortunately :(

@jdm jdm self-assigned this Nov 2, 2015
@jdm

jdm commented Nov 9, 2015

Copy link
Copy Markdown
Member

We clearly need to sort out what freezing means in practice, but obviously that's not happening right now. This change improves the status quo.
@bors-servo: r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit a3859c0 has been approved by jdm

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit a3859c0 with merge f74754f...

@highfive highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 9, 2015
bors-servo pushed a commit that referenced this pull request Nov 9, 2015
Fixed panic in ActiveTimers.set_timeout_or_interval.

`ActiveTimers.set_timeout_or_interval` asserts that the pipeline is not currently frozen. Apparently that is too strict. When pending network requests complete after a pipeline is frozen, scripts may be executed and a timer scheduled.

With these changes scheduling a timer while the pipeline is frozen behaves as if the timer was scheduled at the time the pipeline was frozen.

To reproduce the panic
 1. `./mach run -r http://google.com`,
 2. immediately click on any link and
 3. wait for the panic.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8175)
<!-- Reviewable:end -->
@highfive highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 9, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit a3859c0 into servo:master Nov 9, 2015
bors-servo pushed a commit that referenced this pull request Nov 18, 2015
Correct undisciplined rebase. (Closes #8583.)

I screwed up the rebase on top of #8175; sorry to waste your time with this, @jdm. :(

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8591)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-content/script Related to the script thread I-panic Servo encounters a panic. S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants