Repository navigation
script: Make the resource task communication use IPC channels. - #6586
Conversation
|
Critic review: https://critic.hoppipolla.co.uk/r/5505 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
|
I'm not so happy about the SerializableFoo wrapper structs; can we avoid those somehow? |
|
Only by making our upstream crates take hard dependencies on serde, which I didn't want to do since serde is pretty immature still. |
|
Cargo features? |
|
Everything has gone upstream now except the serde change. However, we can't take the hyper upgrade yet until the rustup lands, because of an ICE. That rustup is itself blocked on mysterious linker errors. We could also fork hyper and backport the change to get ourselves out of this mess. |
|
☔ The latest upstream changes (presumably #6614) made this pull request unmergeable. Please resolve the merge conflicts. |
|
-S-awaiting-review +S-needs-code-changes Reviewed 2 of 20 files at r1, 1 of 10 files at r2, 4 of 17 files at r3, 21 of 29 files at r5, 8 of 8 files at r6. components/devtools_traits/Cargo.toml, line 22 [r6] (raw file): components/net/data_loader.rs, line 33 [r6] (raw file): components/net/http_loader.rs, line 366 [r6] (raw file): components/net/http_loader.rs, line 379 [r6] (raw file): components/net/image_cache_task.rs, line 108 [r6] (raw file): components/net/image_cache_task.rs, line 257 [r6] (raw file): components/net/image_cache_task.rs, line 343 [r6] (raw file): components/net/image_cache_task.rs, line 346 [r6] (raw file): components/net/resource_task.rs, line 282 [r6] (raw file): components/net_traits/lib.rs, line 34 [r6] (raw file): components/script/Cargo.toml, line 68 [r6] (raw file): components/script/dom/htmlscriptelement.rs, line 343 [r6] (raw file): components/script/dom/xmlhttprequest.rs, line 283 [r6] (raw file): components/script/dom/xmlhttprequest.rs, line 798 [r6] (raw file): components/script/network_listener.rs, line 20 [r6] (raw file): components/script/script_task.rs, line 1523 [r6] (raw file): components/util/Cargo.toml, line 25 [r6] (raw file): Comments from the review on Reviewable.io |
|
components/util/Cargo.toml, line 25 [r6] (raw file): Comments from the review on Reviewable.io |
|
Review status: all files reviewed at latest revision, 17 unresolved discussions, some commit checks failed. components/net/data_loader.rs, line 33 [r6] (raw file): components/net/image_cache_task.rs, line 108 [r6] (raw file): components/script/network_listener.rs, line 20 [r6] (raw file): Comments from the review on Reviewable.io |
e12b2c9 to
17c370b
Compare
|
Addressed the review comments. r? @jdm |
|
-S-awaiting-review +S-needs-code-changes Reviewed 1 of 20 files at r1, 31 of 31 files at r7. components/net/data_loader.rs, line 33 [r6] (raw file): components/servo/Cargo.lock, line 1464 [r7] (raw file): ports/cef/Cargo.lock, line 1116 [r7] (raw file): ports/cef/Cargo.lock, line 1411 [r7] (raw file): ports/gonk/Cargo.lock, line 1300 [r7] (raw file): Comments from the review on Reviewable.io |
17c370b to
8ca0de1
Compare
8ca0de1 to
8667004
Compare
|
Review status: 31 of 35 files reviewed at latest revision, 5 unresolved discussions, all commit checks successful. ports/cef/Cargo.lock, line 1116 [r7] (raw file): ports/cef/Cargo.lock, line 1411 [r7] (raw file): Comments from the review on Reviewable.io |
|
☔ The latest upstream changes (presumably #6618) made this pull request unmergeable. Please resolve the merge conflicts. |
8667004 to
097624d
Compare
|
☔ The latest upstream changes (presumably #6591) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Got the hyper upgrade but now blocked on #6765. |
|
☔ The latest upstream changes (presumably #6746) made this pull request unmergeable. Please resolve the merge conflicts. |
|
This is blocked on #6740 landing. |
|
@bors-servo: r=jdm All dependencies of this have landed now, I believe! |
|
@bors-servo: r=jdm |
|
📌 Commit bab24c6 has been approved by |
|
💔 Test failed - mac2 |
|
@bors-servo: r=jdm |
|
📌 Commit 7cdd779 has been approved by |
|
💔 Test failed - linux2 |
|
|
|
|
☔ The latest upstream changes (presumably #6795) made this pull request unmergeable. Please resolve the merge conflicts. |
trait objects across process boundaries.
|
@bors-servo: r=jdm |
|
📌 Commit 61e3a95 has been approved by |
This change makes Servo use serialized messages over IPC channels for resource loading. The goal is to make it easier to make Servo multiprocess in the future. This patch does not make Servo multiprocess now; there are many other channels that need to be changed to IPC before that can happen. It does introduce a dependency on https://github.com/serde-rs/serde and https://github.com/pcwalton/ipc-channel for the first time.
At the moment,
ipc-channeluses JSON for serialization. This is because serde does not yet have official support for bincode. When serde gains support for bincode, I'll switch to that. For now, however, the JSON encoding and decoding will constitute a significant performance regression in resource loading.To avoid having to send boxed
AsyncResponseTargettrait objects across process boundaries, this series of commits changesAsyncResponseTargetto wrap a sender only. It is then the client's responsibility to spawn a thread to proxy calls from that sender to the consumer of the resource data. This only had to be done in a few places. In the future, we may want to collapse those threads into one per process to reduce overhead. (It is impossible to continue to useAsyncResponseTargetas a boxed trait object across processes, regardless of how much work is done onipc-channel. Vtables are fundamentally incompatible with IPC across mutually untrusting processes.)In general, I was pretty pleased with how this turned out. The main changes are adding serialization functionality to various objects that
serdedoes not know how to serialize natively—the most complicated being Hyper objects—and reworkingAsyncResponseTarget. The overall structure of the code is unchanged, and other thanAsyncResponseTargetno functionality was lost in moving to serialization and IPC.r? @jdm