From a4729b51ac16c177a9a49b388b4e24b4fb2b9474 Mon Sep 17 00:00:00 2001 From: Simon B Date: Mon, 11 Dec 2017 15:51:52 +0100 Subject: [PATCH] Issue 458 too verbose slog lines initial sync (#459) * Alleviate slog-async channel overflow by shortening while clarifying some log lines. * add debug logging to GetBlock handling * make another log line less rendudantly chatty --- grin/src/seed.rs | 4 ++-- p2p/src/protocol.rs | 2 ++ p2p/src/server.rs | 4 ++-- p2p/src/store.rs | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/grin/src/seed.rs b/grin/src/seed.rs index 4e6cca91..ae356e68 100644 --- a/grin/src/seed.rs +++ b/grin/src/seed.rs @@ -300,7 +300,7 @@ fn connect_and_req( let fut = connect_peer.then(move |p| { match p { Ok(Some(p)) => { - debug!(LOGGER, "connect_and_req: ok, will attempt send_peer_request"); + debug!(LOGGER, "connect_and_req: ok. attempting send_peer_request"); if let Ok(p) = p.try_read() { let _ = p.send_peer_request(capab); } @@ -309,7 +309,7 @@ fn connect_and_req( debug!(LOGGER, "connect_and_req: ok but none inner (what does this mean?), {}", addr); }, Err(e) => { - debug!(LOGGER, "connect_and_req: err - {:?}, {}, flagging as defunct", e, addr); + debug!(LOGGER, "connect_and_req: {} is Defunct; {:?}", addr, e); let _ = p2p_server.update_state(addr, p2p::State::Defunct); }, } diff --git a/p2p/src/protocol.rs b/p2p/src/protocol.rs index ba67db6a..9dcad8c1 100644 --- a/p2p/src/protocol.rs +++ b/p2p/src/protocol.rs @@ -167,6 +167,8 @@ fn handle_payload( } Type::GetBlock => { let h = ser::deserialize::(&mut &buf[..])?; + debug!(LOGGER, "handle_payload: GetBlock {}", h); + let bo = adapter.get_block(h); if let Some(b) = bo { // serialize and send the block over diff --git a/p2p/src/server.rs b/p2p/src/server.rs index 04ff4b06..4327c139 100644 --- a/p2p/src/server.rs +++ b/p2p/src/server.rs @@ -529,11 +529,11 @@ fn with_timeout( Ok(inner) }, Ok((Err(inner), _accept)) => { - debug!(LOGGER, "with_timeout: ok but nested - {:?} (treating this as timeout)", inner); + debug!(LOGGER, "with_timeout: ok, timeout. nested={:?}", inner); Err(Error::Timeout) }, Err((e, _other)) => { - debug!(LOGGER, "with_timeout: err - {:?} (treating this as an error)", e); + debug!(LOGGER, "with_timeout: err. {:?}", e); Err(e) }, }); diff --git a/p2p/src/store.rs b/p2p/src/store.rs index 4cb77c11..8748ad45 100644 --- a/p2p/src/store.rs +++ b/p2p/src/store.rs @@ -96,7 +96,7 @@ impl PeerStore { } pub fn save_peer(&self, p: &PeerData) -> Result<(), Error> { - debug!(LOGGER, "saving peer to store {:?}", p); + debug!(LOGGER, "save_peer: {:?} marked {:?}", p.addr, p.flags); self.db.put_ser(&peer_key(p.addr)[..], p) }