Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRemoved sources of panic from ports/glutin. #10910
Conversation
| None => { | ||
| warn!("Window event stream closed."); | ||
| return false; | ||
| }, |
This comment has been minimized.
This comment has been minimized.
samlh
Apr 28, 2016
Contributor
Return true? #10547 implies that this can happen when the window is closing.
This comment has been minimized.
This comment has been minimized.
asajeffrey
Apr 28, 2016
Author
Member
I wasn't sure about what to do here, most likely the window is already closing, and I'm not sure what'll happen if we try to close it twice? Is it idempotent?
|
I can't make a call on what to do about the returned value here. r? @pcwalton |
|
|
2d81522
to
234c9f7
234c9f7
to
135c6db
|
|
135c6db
to
74b466f
|
Rebased. |
74b466f
to
caab457
|
Rebased and bumped log to 0.3.6. |
|
|
caab457
to
55f1cf4
|
Rebased. I had a think about what the return value should be from |
|
Not that I have any authority, but this looks good to me :). |
55f1cf4
to
37511cc
highfive
commented
May 20, 2016
|
New code was committed to pull request. |
|
Rebased. |
|
@bors-servo r+ |
|
|
…eeshusa Removed sources of panic from ports/glutin. Fixes #10547. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10910) <!-- Reviewable:end -->
|
|
|
Hmm. I have a fix for this as well, but on the glutin side. See rust-windowing/glutin#777. The difference is that the change to glutin will prevent wait_events() from returning None. What happens that once glutin gets a WM_DESTROY event (to close the window) it shuts down its event loops which causes recv() to panic, but the iterator discards the error and just returns None. This patch is fine though as it doesn't coflict; it may cease to be necessary in the near future. |
|
We probably want to remove sources of panic from ports/glutin anway, since it's one of our single points of failure, a panic in ports/glutin brings down the whole browser. I'm quite happy about having a belt-and-braces approach here. |
|
The issue here is that by returning immediately, you now have a very hot loop. This whole loop was written with the assumption that it would block here, and now that it's gone as soon as WM_DESTROY comes in, we probably spike to 100% CPU until shutdown. |
|
@metajack ah, the problem is that there's nothing |
|
Event processing isn't finished, though. We're waiting for shutdown to fully propagate. In my patch wait_events() blocks until the WAKEUP message arrives, and then we'll pull the FinishedShuttingDown message out of the other event queue. Maybe we can block on that event queue if we're in shutdown? The main issue here is we have two event queues and Rust has nothing like select(). |
|
Moving the conversation about hot-spinning at shutdown to #11307. |
asajeffrey commentedApr 28, 2016
•
edited by larsbergstrom
Fixes #10547.
This change is