Diagnostics for CI port conflict failures (#1766)
Log a "Trying..." message before each listener opens, to see if the delay is inside Zebra, or in the test harness or OS. Also report the configured and actual ports where possible, for better diagnostics.
This commit is contained in:
parent
5424e1d8ba
commit
e61b5e50a2
|
|
@ -227,6 +227,7 @@ where
|
||||||
S: Service<(TcpStream, SocketAddr), Response = peer::Client, Error = BoxError> + Clone,
|
S: Service<(TcpStream, SocketAddr), Response = peer::Client, Error = BoxError> + Clone,
|
||||||
S::Future: Send + 'static,
|
S::Future: Send + 'static,
|
||||||
{
|
{
|
||||||
|
info!("Trying to open Zcash protocol endpoint at {}...", addr);
|
||||||
let listener_result = TcpListener::bind(addr).await;
|
let listener_result = TcpListener::bind(addr).await;
|
||||||
|
|
||||||
let listener = match listener_result {
|
let listener = match listener_result {
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@ impl MetricsEndpoint {
|
||||||
/// Create the component.
|
/// Create the component.
|
||||||
pub fn new(config: &ZebradConfig) -> Result<Self, FrameworkError> {
|
pub fn new(config: &ZebradConfig) -> Result<Self, FrameworkError> {
|
||||||
if let Some(addr) = config.metrics.endpoint_addr {
|
if let Some(addr) = config.metrics.endpoint_addr {
|
||||||
|
info!("Trying to open metrics endpoint at {}...", addr);
|
||||||
let endpoint_result = metrics_exporter_prometheus::PrometheusBuilder::new()
|
let endpoint_result = metrics_exporter_prometheus::PrometheusBuilder::new()
|
||||||
.listen_address(addr)
|
.listen_address(addr)
|
||||||
.install();
|
.install();
|
||||||
match endpoint_result {
|
match endpoint_result {
|
||||||
Ok(endpoint) => {
|
Ok(()) => {
|
||||||
info!("Opened metrics endpoint at {}", addr);
|
info!("Opened metrics endpoint at {}", addr);
|
||||||
endpoint
|
|
||||||
}
|
}
|
||||||
Err(e) => panic!(
|
Err(e) => panic!(
|
||||||
"Opening metrics endpoint listener {:?} failed: {:?}. \
|
"Opening metrics endpoint listener {:?} failed: {:?}. \
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ impl TracingEndpoint {
|
||||||
let service =
|
let service =
|
||||||
make_service_fn(|_| async { Ok::<_, hyper::Error>(service_fn(request_handler)) });
|
make_service_fn(|_| async { Ok::<_, hyper::Error>(service_fn(request_handler)) });
|
||||||
|
|
||||||
|
info!("Trying to open tracing endpoint at {}...", addr);
|
||||||
tokio_component
|
tokio_component
|
||||||
.rt
|
.rt
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
|
@ -53,10 +54,7 @@ impl TracingEndpoint {
|
||||||
// try_bind uses the tokio runtime, so we
|
// try_bind uses the tokio runtime, so we
|
||||||
// need to construct it inside the task.
|
// need to construct it inside the task.
|
||||||
let server = match Server::try_bind(&addr) {
|
let server = match Server::try_bind(&addr) {
|
||||||
Ok(s) => {
|
Ok(s) => s,
|
||||||
info!("Opened tracing endpoint at {}", addr);
|
|
||||||
s
|
|
||||||
}
|
|
||||||
Err(e) => panic!(
|
Err(e) => panic!(
|
||||||
"Opening tracing endpoint listener {:?} failed: {:?}. \
|
"Opening tracing endpoint listener {:?} failed: {:?}. \
|
||||||
Hint: Check if another zebrad or zcashd process is running. \
|
Hint: Check if another zebrad or zcashd process is running. \
|
||||||
|
|
@ -66,6 +64,8 @@ impl TracingEndpoint {
|
||||||
}
|
}
|
||||||
.serve(service);
|
.serve(service);
|
||||||
|
|
||||||
|
info!("Opened tracing endpoint at {}", server.local_addr());
|
||||||
|
|
||||||
if let Err(e) = server.await {
|
if let Err(e) = server.await {
|
||||||
error!("Server error: {}", e);
|
error!("Server error: {}", e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue