From b83a72a4cead0c488586fb50ecea1c5c7b5a3fe8 Mon Sep 17 00:00:00 2001 From: Adam Wright Date: Tue, 26 Jan 2016 20:42:18 -0800 Subject: [PATCH 1/5] Some logs to help with debugging --- tarpc/src/protocol.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tarpc/src/protocol.rs b/tarpc/src/protocol.rs index f985913..bba02b9 100644 --- a/tarpc/src/protocol.rs +++ b/tarpc/src/protocol.rs @@ -164,9 +164,6 @@ impl<'a, S> ConnectionHandler<'a, S> where S: Serve { Err(bincode::serde::DeserializeError::IoError(ref err)) if Self::timed_out(err.kind()) => { if !shutdown.load(Ordering::SeqCst) { - info!("ConnectionHandler: read timed out ({:?}). Server not \ - shutdown, so retrying read.", - err); continue; } else { info!("ConnectionHandler: read timed out ({:?}). Server shutdown, so \ @@ -460,10 +457,15 @@ impl Client err); try!(self.requests.lock().unwrap().remove_tx(id)); } + debug!("finishing rpc({:?})", request); drop(state); + debug!("recv"); match rx.recv() { Ok(msg) => Ok(msg), - Err(_) => Err(self.requests.lock().unwrap().get_error()), + Err(_) => { + debug!("locking requests map"); + let r = Err(self.requests.lock().unwrap().get_error()); + } } } } From 4db54932d800c89e5286be2d2be71ccb542772fc Mon Sep 17 00:00:00 2001 From: Adam Wright Date: Tue, 26 Jan 2016 20:48:21 -0800 Subject: [PATCH 2/5] Fix brokenness and add another log --- tarpc/src/protocol.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tarpc/src/protocol.rs b/tarpc/src/protocol.rs index bba02b9..ea9a88b 100644 --- a/tarpc/src/protocol.rs +++ b/tarpc/src/protocol.rs @@ -139,6 +139,7 @@ impl<'a, S> ConnectionHandler<'a, S> where S: Serve { loop { match Self::read(read_stream, timeout) { Ok(Packet { rpc_id, message, }) => { + debug!("ConnectionHandler: serving request, id: {}, message: {:?}", rpc_id, message); inflight_rpcs.increment(); scope.spawn(move || { let reply = server.serve(message); @@ -457,14 +458,14 @@ impl Client err); try!(self.requests.lock().unwrap().remove_tx(id)); } - debug!("finishing rpc({:?})", request); + debug!("Client: finishing rpc({:?})", request); drop(state); - debug!("recv"); + debug!("Client: recv"); match rx.recv() { Ok(msg) => Ok(msg), Err(_) => { debug!("locking requests map"); - let r = Err(self.requests.lock().unwrap().get_error()); + Err(self.requests.lock().unwrap().get_error()) } } } From 25b7f4887ec20cf8d0318134a247b9badb5e8009 Mon Sep 17 00:00:00 2001 From: Tim Kuehn Date: Tue, 26 Jan 2016 21:48:02 -0800 Subject: [PATCH 3/5] Add disclaimer to README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1384825..20ffc72 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -## tarpc +## tarpc: Tim & Adam's RPC lib +*Disclaimer*: This is not an official Google product. tarpc is an RPC framework for rust with a focus on ease of use. Defining and implementing an echo-like server can be done in just a few lines of code: From 54dbd74e2f9e9160d64a9858b483228b9279d8c8 Mon Sep 17 00:00:00 2001 From: Tim Kuehn Date: Tue, 26 Jan 2016 22:03:46 -0800 Subject: [PATCH 4/5] Replace planned generic serialization feature with backward-compatibility features --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20ffc72..326b11a 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ The `rpc!` macro generates a module in the current module. In the above example, ## Planned Improvements (actively being worked on) - Automatically reconnect on the client side when the connection cuts out. - Allow omitting the return type in rpc definitions when the type is `()`. -- Support arbitrary serialization (currently `bincode` is used for all serialization). +- Add backward-compatibility features to enable evolving APIs. - Support asynchronous server implementations (currently thread per connection). ## Contributing From 707daff475e7c582a66105372325854766d948d5 Mon Sep 17 00:00:00 2001 From: Adam Wright Date: Wed, 27 Jan 2016 22:18:04 -0800 Subject: [PATCH 5/5] Remove superfluous log --- tarpc/src/protocol.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/tarpc/src/protocol.rs b/tarpc/src/protocol.rs index ea9a88b..b6ebfef 100644 --- a/tarpc/src/protocol.rs +++ b/tarpc/src/protocol.rs @@ -460,7 +460,6 @@ impl Client } debug!("Client: finishing rpc({:?})", request); drop(state); - debug!("Client: recv"); match rx.recv() { Ok(msg) => Ok(msg), Err(_) => {