Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnostics for listener conflict CI failures #1766

Merged
merged 1 commit into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions zebra-network/src/peer_set/initialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ where
S: Service<(TcpStream, SocketAddr), Response = peer::Client, Error = BoxError> + Clone,
S::Future: Send + 'static,
{
info!("Trying to open Zcash protocol endpoint at {}...", addr);
let listener_result = TcpListener::bind(addr).await;

let listener = match listener_result {
Expand Down
4 changes: 2 additions & 2 deletions zebrad/src/components/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ impl MetricsEndpoint {
/// Create the component.
pub fn new(config: &ZebradConfig) -> Result<Self, FrameworkError> {
if let Some(addr) = config.metrics.endpoint_addr {
info!("Trying to open metrics endpoint at {}...", addr);
let endpoint_result = metrics_exporter_prometheus::PrometheusBuilder::new()
.listen_address(addr)
.install();
match endpoint_result {
Ok(endpoint) => {
Ok(()) => {
info!("Opened metrics endpoint at {}", addr);
endpoint
}
Err(e) => panic!(
"Opening metrics endpoint listener {:?} failed: {:?}. \
Expand Down
8 changes: 4 additions & 4 deletions zebrad/src/components/tracing/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ impl TracingEndpoint {
let service =
make_service_fn(|_| async { Ok::<_, hyper::Error>(service_fn(request_handler)) });

info!("Trying to open tracing endpoint at {}...", addr);
tokio_component
.rt
.as_ref()
Expand All @@ -53,10 +54,7 @@ impl TracingEndpoint {
// try_bind uses the tokio runtime, so we
// need to construct it inside the task.
let server = match Server::try_bind(&addr) {
Ok(s) => {
info!("Opened tracing endpoint at {}", addr);
s
}
Ok(s) => s,
Err(e) => panic!(
"Opening tracing endpoint listener {:?} failed: {:?}. \
Hint: Check if another zebrad or zcashd process is running. \
Expand All @@ -66,6 +64,8 @@ impl TracingEndpoint {
}
.serve(service);

info!("Opened tracing endpoint at {}", server.local_addr());

if let Err(e) = server.await {
error!("Server error: {}", e);
}
Expand Down