Auto merge of #8660 - pcwalton:ipc-channel-errors, r=larsbergstrom

Update `ipc-channel` to pick up the improved error reporting.

Intended to help diagnose intermittent failures.

r? @jdm or @larsbergstrom (or whoever)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8660)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-11-25 07:31:15 +05:30
commit 13a96fcaf7
23 changed files with 84 additions and 78 deletions

View file

@ -32,7 +32,7 @@ git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
features = ["texture_surface"]
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies]
cssparser = { version = "0.4", features = [ "serde-serialization" ] }

View file

@ -22,7 +22,7 @@ features = ["plugins"]
git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.serde]
version = "0.6"

View file

@ -58,7 +58,7 @@ features = ["plugins"]
git = "https://github.com/aweinstock314/rust-clipboard"
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.offscreen_gl_context]
git = "https://github.com/ecoal95/rust-offscreen-rendering-context"

View file

@ -24,7 +24,7 @@ path = "../util"
path = "../plugins"
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.url]
version = "0.2"

View file

@ -22,7 +22,7 @@ version = "0.2"
features = [ "serde_serialization" ]
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.plugins]
path = "../plugins"

View file

@ -65,7 +65,7 @@ git = "https://github.com/servo/skia"
path = "../script_traits"
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.url]
version = "0.2"

View file

@ -54,7 +54,7 @@ path = "../util"
git = "https://github.com/tomaka/clock_ticks"
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.url]
version = "0.2"

View file

@ -26,7 +26,7 @@ path = "../profile_traits"
path = "../util"
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.url]
version = "0.2"

View file

@ -33,7 +33,7 @@ version = "0.2.36"
features = [ "serde_serialization" ]
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.offscreen_gl_context]
git = "https://github.com/ecoal95/rust-offscreen-rendering-context"

View file

@ -30,7 +30,7 @@ features = [ "serde-serialization" ]
path = "../msg"
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.url]
version = "0.2"

View file

@ -21,7 +21,7 @@ version = "0.6"
features = [ "serde-serialization" ]
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.url]
version = "0.2"

View file

@ -20,7 +20,7 @@ path = "../util"
git = "https://github.com/libheartbeats/heartbeats-simple-rust.git"
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies]
log = "0.3"

View file

@ -11,7 +11,7 @@ path = "lib.rs"
energy-profiling = ["energymon", "energy-monitor"]
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.energymon]
git = "https://github.com/energymon/energymon-rust.git"

View file

@ -57,7 +57,7 @@ git = "https://github.com/ecoal95/angle"
branch = "servo"
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.hyper]
version = "0.6"

View file

@ -26,7 +26,7 @@ path = "../util"
path = "../devtools_traits"
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.url]
version = "0.2"

View file

@ -17,7 +17,7 @@ dependencies = [
"gleam 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_app 0.0.1",
"image 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"layout 0.0.1",
"libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
@ -159,7 +159,7 @@ dependencies = [
"euclid 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1",
"gleam 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"log 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)",
@ -176,7 +176,7 @@ dependencies = [
"cssparser 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"plugins 0.0.1",
@ -269,7 +269,7 @@ dependencies = [
"gfx_traits 0.0.1",
"gleam 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"layout_traits 0.0.1",
"libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
@ -357,7 +357,7 @@ version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"hyper 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"log 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"plugins 0.0.1",
@ -375,7 +375,7 @@ version = "0.0.1"
dependencies = [
"bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"msg 0.0.1",
"plugins 0.0.1",
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
@ -656,7 +656,7 @@ dependencies = [
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
"gfx_traits 0.0.1",
"harfbuzz-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
@ -940,7 +940,7 @@ dependencies = [
[[package]]
name = "ipc-channel"
version = "0.1.0"
source = "git+https://github.com/pcwalton/ipc-channel#5e71fe6a1831e61e01ec8580bd3c3280b25d6054"
source = "git+https://github.com/servo/ipc-channel#a7da16d710cfbb5d05c8315a5fbc04dd58399887"
dependencies = [
"bincode 0.4.0 (git+https://github.com/TyOverby/bincode)",
"byteorder 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
@ -949,6 +949,7 @@ dependencies = [
"rand 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1019,7 +1020,7 @@ dependencies = [
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1",
"gfx_traits 0.0.1",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"layout_traits 0.0.1",
"libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1050,7 +1051,7 @@ version = "0.0.1"
dependencies = [
"euclid 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"msg 0.0.1",
"net_traits 0.0.1",
"profile_traits 0.0.1",
@ -1183,7 +1184,7 @@ dependencies = [
"euclid 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"io-surface 0.1.1 (git+https://github.com/servo/io-surface-rs)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"plugins 0.0.1",
@ -1205,7 +1206,7 @@ dependencies = [
"euclid 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"log 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"mime_guess 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
@ -1227,7 +1228,7 @@ dependencies = [
"devtools_traits 0.0.1",
"flate2 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"msg 0.0.1",
"net 0.0.1",
"net_traits 0.0.1",
@ -1244,7 +1245,7 @@ dependencies = [
"euclid 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"log 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"plugins 0.0.1",
@ -1435,7 +1436,7 @@ name = "profile"
version = "0.0.1"
dependencies = [
"hbs-pow 0.1.0 (git+https://github.com/libheartbeats/heartbeats-simple-rust.git)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
@ -1452,7 +1453,7 @@ version = "0.0.1"
dependencies = [
"energy-monitor 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"energymon 0.1.0 (git+https://github.com/energymon/energymon-rust.git?rev=eba1d8a)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"plugins 0.0.1",
"serde 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1542,7 +1543,7 @@ dependencies = [
"html5ever 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"js 0.1.1 (git+https://github.com/servo/rust-mozjs)",
"libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1587,7 +1588,7 @@ dependencies = [
"app_units 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1",
"euclid 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
@ -1933,7 +1934,7 @@ dependencies = [
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"js 0.1.1 (git+https://github.com/servo/rust-mozjs)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2029,7 +2030,7 @@ version = "0.0.1"
dependencies = [
"hyper 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)",
"log 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"plugins 0.0.1",

View file

@ -136,7 +136,7 @@ features = ["plugins"]
git = "https://github.com/pcwalton/gaol"
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.layers]
git = "https://github.com/servo/rust-layers"

View file

@ -30,7 +30,7 @@ git = "https://github.com/servo/rust-layers"
features = ["plugins"]
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.url]
version = "0.2"

View file

@ -8,6 +8,7 @@ use opts;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::any::{Any, TypeId};
use std::collections::HashMap;
use std::io::{Error, ErrorKind};
use std::marker::Reflect;
use std::mem;
use std::sync::Mutex;
@ -27,10 +28,12 @@ pub enum OptionalIpcSender<T> where T: Deserialize + Serialize + Send + Any {
}
impl<T> OptionalIpcSender<T> where T: Deserialize + Serialize + Send + Any {
pub fn send(&self, value: T) -> Result<(), ()> {
pub fn send(&self, value: T) -> Result<(), Error> {
match *self {
OptionalIpcSender::OutOfProcess(ref ipc_sender) => ipc_sender.send(value),
OptionalIpcSender::InProcess(ref sender) => sender.send(value).map_err(|_| ()),
OptionalIpcSender::InProcess(ref sender) => {
sender.send(value).map_err(|_| Error::new(ErrorKind::Other, "MPSC send failed"))
}
}
}

View file

@ -20,7 +20,7 @@ path = "../util"
git = "https://github.com/jgraham/webdriver-rust.git"
[dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel"
git = "https://github.com/servo/ipc-channel"
[dependencies.url]
version = "0.2"