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

server: downgrade connection logs to debug #1123

Merged
merged 1 commit into from
May 17, 2023
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
8 changes: 4 additions & 4 deletions server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ impl<L: Logger> hyper::service::Service<hyper::Request<hyper::Body>> for TowerSe
};

if let Err(e) = self.inner.allow_hosts.verify(host) {
tracing::warn!("Denied request: {}", e);
tracing::debug!("Denied request: {}", e);
return async { Ok(http::response::host_not_allowed()) }.boxed();
}

Expand All @@ -645,7 +645,7 @@ impl<L: Logger> hyper::service::Service<hyper::Request<hyper::Body>> for TowerSe
let upgraded = match hyper::upgrade::on(request).await {
Ok(u) => u,
Err(e) => {
tracing::warn!("Could not upgrade connection: {}", e);
tracing::debug!("Could not upgrade connection: {}", e);
return;
}
};
Expand Down Expand Up @@ -758,7 +758,7 @@ fn process_connection<'a, L: Logger, B, U>(
let conn = match connection_guard.try_acquire() {
Some(conn) => conn,
None => {
tracing::warn!("Too many connections. Please try again later.");
tracing::debug!("Too many connections. Please try again later.");
connections.push(tokio::spawn(http::reject_connection(socket).in_current_span()));
return;
}
Expand Down Expand Up @@ -821,7 +821,7 @@ where
};

if let Err(e) = res {
tracing::warn!("HTTP serve connection failed {:?}", e);
tracing::debug!("HTTP serve connection failed {:?}", e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion server/src/transport/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub(crate) async fn reject_connection(socket: tokio::net::TcpStream) {

if let Err(e) = hyper::server::conn::Http::new().serve_connection(socket, hyper::service::service_fn(reject)).await
{
tracing::warn!("Error when trying to deny connection: {:?}", e);
tracing::debug!("HTTP serve connection failed {:?}", e);
}
}

Expand Down