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 upRestructure content process shutdown ack with threaded sender #23972
Conversation
highfive
commented
Aug 15, 2019
|
Heads up! This PR modifies the following files:
|
highfive
commented
Aug 15, 2019
|
This is another recycled commit from the big ipc experiment over at #23909 In this case, it restructures the "wait for content to shutdown" pattern, in the following way:
@asajeffrey r? |
|
r? @asajeffrey |
|
I'm a bit confused by these changes. Replacing an IPC channel by a crossbeam channel IO can understand, since the channel never leaves the process. But AFAICT the channel is being used as a latch, we're never actually sending a message on it? |
| let signal = content_process_shutdown_port.recv(); | ||
| // When the script-thread drops the sender, | ||
| // we expect to receive an Err(_). | ||
| assert!(signal.is_err()); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
gterzian
Aug 15, 2019
Author
Member
It's not in the constellation thread actually, but I guess an error is better.
| let signal = content_process_shutdown_port.recv(); | ||
| // When the script-thread drops the sender, | ||
| // we expect to receive an Err(_). | ||
| assert!(signal.is_err()); |
This comment has been minimized.
This comment has been minimized.
asajeffrey
Aug 15, 2019
Member
I'm confused about who sends on this channel, since the only uses of send(()) appear to have been deleted. Are we using a channel just for its Drop implementation?
This comment has been minimized.
This comment has been minimized.
gterzian
Aug 15, 2019
•
Author
Member
Yes, previously there was an explicit sending of a message when the script-thread exits, which I can bring back if you think that's clearer. Or we can effectively wait until the channel drops, and assert it is indeed the Err that would be received in such a case.
I think we can count on the channel not sending any spurious errors.
This comment has been minimized.
This comment has been minimized.
gterzian
Aug 15, 2019
•
Author
Member
Actually, I think you're right it's better to send an explicit message, since the drop could also be the result of an unexpected shutdown of the script-thread, while a message will almost always mean there was a graceful shutdown...
| @@ -744,6 +744,7 @@ impl ScriptThreadFactory for ScriptThread { | |||
| thread_state::initialize(ThreadState::SCRIPT); | |||
| PipelineNamespace::install(state.pipeline_namespace_id); | |||
| TopLevelBrowsingContextId::install(state.top_level_browsing_context_id); | |||
|
|
|||
This comment has been minimized.
This comment has been minimized.
afc6480
to
4cd2730
|
Ok, comments addressed @asajeffrey |
|
OK, a question, but otherwise LGTM. |
| @@ -545,6 +530,7 @@ impl UnprivilegedPipelineContent { | |||
| self.script_chan.clone(), | |||
| self.load_data.url.clone(), | |||
| ); | |||
| let (content_process_shutdown_chan, content_process_shutdown_port) = unbounded(); | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
gterzian
Aug 17, 2019
Author
Member
I see what you mean, counterintuitively, the unbounded variant appears to require less bookkeeping than the bounded variant.
|
@bors-servo r+ |
|
|
… r=asajeffrey Restructure content process shutdown ack with threaded sender Recycling some work from #23909 <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23972) <!-- Reviewable:end -->
|
|
…t layout
4cd2730
to
8482d2e
|
@asajeffrey Ok that was |
|
@bors-servo r+ |
|
|
… r=asajeffrey Restructure content process shutdown ack with threaded sender Recycling some work from #23909 <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23972) <!-- Reviewable:end -->
|
|
|
@bors-servo retry seems like a taskcluster error: |
|
|
… r=asajeffrey Restructure content process shutdown ack with threaded sender Recycling some work from #23909 <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23972) <!-- Reviewable:end -->
|
|
gterzian commentedAug 15, 2019
•
edited by SimonSapin
Recycling some work from #23909
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is