Merge branch 'debug' into 'master'

Debug



See merge request !13
This commit is contained in:
Tim
2016-01-28 11:51:35 +05:30

View File

@@ -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);
@@ -164,9 +165,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 +458,14 @@ impl<Request, Reply> Client<Request, Reply>
err);
try!(self.requests.lock().unwrap().remove_tx(id));
}
debug!("Client: finishing rpc({:?})", request);
drop(state);
match rx.recv() {
Ok(msg) => Ok(msg),
Err(_) => Err(self.requests.lock().unwrap().get_error()),
Err(_) => {
debug!("locking requests map");
Err(self.requests.lock().unwrap().get_error())
}
}
}
}