From ff79693568267b94c63cbbced126769dce291f73 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2019 13:23:10 -0700 Subject: [PATCH] Use built-in solana-gossip timeout for better error messages (#6189) (#6203) automerge --- gossip/src/main.rs | 8 ++++++-- net/remote/remote-sanity.sh | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gossip/src/main.rs b/gossip/src/main.rs index 715792512f..410c29b03d 100644 --- a/gossip/src/main.rs +++ b/gossip/src/main.rs @@ -111,7 +111,7 @@ fn main() -> Result<(), Box> { if let Some(addr) = matches.value_of("entrypoint") { entrypoint_addr = solana_netutil::parse_host_port(addr).unwrap_or_else(|e| { eprintln!("failed to parse entrypoint address: {}", e); - exit(1) + exit(1); }); } @@ -120,7 +120,7 @@ fn main() -> Result<(), Box> { addr.set_ip( solana_netutil::get_public_ip_addr(&entrypoint_addr).unwrap_or_else(|err| { eprintln!("failed to contact {}: {}", entrypoint_addr, err); - exit(1) + exit(1); }), ); Some(addr) @@ -163,11 +163,13 @@ fn main() -> Result<(), Box> { "Error: Insufficient nodes discovered. Expecting {}{}", num, add, ); + exit(1); } } if let Some(node) = pubkey { if nodes.iter().find(|x| x.id == node).is_none() { eprintln!("Error: Could not find node {:?}", node); + exit(1); } } } @@ -176,6 +178,7 @@ fn main() -> Result<(), Box> { "Error: Extra nodes discovered. Expecting exactly {}", num_nodes_exactly.unwrap() ); + exit(1); } } ("get-rpc-url", Some(matches)) => { @@ -220,6 +223,7 @@ fn main() -> Result<(), Box> { if !ContactInfo::is_valid_address(&node.rpc) { eprintln!("Error: RPC service is not enabled on node {:?}", pubkey); + exit(1); } println!("\nSending stop request to node {:?}", pubkey); diff --git a/net/remote/remote-sanity.sh b/net/remote/remote-sanity.sh index 1f0c07967f..f4356d0c5d 100755 --- a/net/remote/remote-sanity.sh +++ b/net/remote/remote-sanity.sh @@ -94,8 +94,8 @@ echo "+++ $sanityTargetIp: node count ($numSanityNodes expected)" nodeArg="num-nodes-exactly" fi - timeout 2m $solana_gossip --entrypoint "$sanityTargetIp:8001" \ - spy --$nodeArg "$numSanityNodes" \ + $solana_gossip --entrypoint "$sanityTargetIp:8001" \ + spy --$nodeArg "$numSanityNodes" --timeout 60 \ ) echo "--- $sanityTargetIp: RPC API: getTransactionCount"