From 852de0e08545f909b0eb00406bcb1780c4a52c4c Mon Sep 17 00:00:00 2001 From: clockwork-labs-bot Date: Mon, 15 Jun 2026 01:05:17 -0400 Subject: [PATCH 1/2] Reduce noisy server logs --- crates/client-api/src/lib.rs | 2 +- crates/client-api/src/routes/database.rs | 6 +++--- crates/client-api/src/routes/subscribe.rs | 8 ++++---- crates/core/src/client/client_connection.rs | 12 ++++++++---- .../src/subscription/module_subscription_manager.rs | 4 ++-- .../datastore/src/locking_tx_datastore/state_view.rs | 2 +- crates/pg/src/pg_server.rs | 2 +- 7 files changed, 20 insertions(+), 16 deletions(-) diff --git a/crates/client-api/src/lib.rs b/crates/client-api/src/lib.rs index 7ec13a670de..d764fc38ffe 100644 --- a/crates/client-api/src/lib.rs +++ b/crates/client-api/src/lib.rs @@ -146,7 +146,7 @@ impl Host { .await .map_err(|_| (StatusCode::NOT_FOUND, "module not found".to_string()))?; - tracing::info!(sql = body); + tracing::debug!(sql = body); let mut header = vec![]; let sql_start = std::time::Instant::now(); let sql_span = tracing::trace_span!("execute_sql", total_duration = tracing::field::Empty,); diff --git a/crates/client-api/src/routes/database.rs b/crates/client-api/src/routes/database.rs index 893c0ec9c15..7c8bb582093 100644 --- a/crates/client-api/src/routes/database.rs +++ b/crates/client-api/src/routes/database.rs @@ -25,7 +25,7 @@ use derive_more::From; use futures::TryStreamExt; use http::StatusCode; use http_body_util::BodyExt; -use log::{info, warn}; +use log::{debug, info, warn}; use serde::Deserialize; use spacetimedb::auth::identity::ConnectionAuthCtx; use spacetimedb::database_logger::DatabaseLogger; @@ -1232,7 +1232,7 @@ pub async fn pre_publish PrettyPrintStyle::AnsiColor => AutoMigratePrettyPrintStyle::AnsiColor, }; - info!("planning migration for database {database_identity}"); + debug!("planning migration for database {database_identity}"); let migrate_plan = ctx .migrate_plan( DatabaseDef { @@ -1256,7 +1256,7 @@ pub async fn pre_publish plan, major_version_upgrade, } => { - info!( + debug!( "planned auto-migration of database {} from {} to {}", database_identity, old_module_hash, new_module_hash ); diff --git a/crates/client-api/src/routes/subscribe.rs b/crates/client-api/src/routes/subscribe.rs index f29527bee42..cc97ccfc961 100644 --- a/crates/client-api/src/routes/subscribe.rs +++ b/crates/client-api/src/routes/subscribe.rs @@ -252,7 +252,7 @@ where connected } Err(e @ (ClientConnectedError::Rejected(_) | ClientConnectedError::OutOfEnergy)) => { - log::info!( + log::debug!( "websocket: Rejecting connection for {client_log_string} due to error from client_connected reducer: {e}" ); return; @@ -504,7 +504,7 @@ async fn ws_client_actor_inner( let _ = unordered_tx.send(msg); }) .await; - log::info!("Client connection ended: {client_id}"); + log::debug!("Client connection ended: {client_id}"); } /// The main `select!` loop of the websocket client actor. @@ -668,7 +668,7 @@ async fn ws_main_loop( // Exit if we haven't heard from the client for too long. _ = &mut idle_timer => { - log::warn!("Client {} timed out", state.client_id); + log::debug!("Client {} timed out", state.client_id); break; }, @@ -923,7 +923,7 @@ fn ws_recv_queue( reason: Utf8Bytes::from_static("too many requests"), }); let on_message_after_close = move |client_id| { - log::warn!("client {client_id} sent message after close or error"); + log::debug!("client {client_id} sent message after close or error"); }; let max_incoming_queue_length = state.config.incoming_queue_length.get(); diff --git a/crates/core/src/client/client_connection.rs b/crates/core/src/client/client_connection.rs index 8f19156d6bb..95aa4d439bc 100644 --- a/crates/core/src/client/client_connection.rs +++ b/crates/core/src/client/client_connection.rs @@ -21,6 +21,7 @@ use derive_more::From; use futures::prelude::*; use log::warn; use prometheus::{Histogram, IntCounter, IntGauge}; +use scopeguard::ScopeGuard; use spacetimedb_auth::identity::{ConnectionAuthCtx, SpacetimeIdentityClaims}; use spacetimedb_client_api_messages::websocket::{common as ws_common, v1 as ws_v1, v2 as ws_v2}; use spacetimedb_durability::{DurableOffset, TxOffset}; @@ -863,13 +864,16 @@ impl ClientConnection { let _gauge_guard = module_info.metrics.connected_clients.inc_scope(); module_info.metrics.ws_clients_spawned.inc(); - scopeguard::defer! { + let abort_guard = scopeguard::guard((), |_| { let database_identity = module_info.database_identity; - log::warn!("websocket connection aborted for client identity `{client_identity}` and database identity `{database_identity}`"); + log::warn!( + "websocket connection aborted for client identity `{client_identity}` and database identity `{database_identity}`" + ); module_info.metrics.ws_clients_aborted.inc(); - }; + }); - fut.await + fut.await; + ScopeGuard::into_inner(abort_guard); }) .abort_handle(); diff --git a/crates/core/src/subscription/module_subscription_manager.rs b/crates/core/src/subscription/module_subscription_manager.rs index 3159b7e7b1e..b96e417d58b 100644 --- a/crates/core/src/subscription/module_subscription_manager.rs +++ b/crates/core/src/subscription/module_subscription_manager.rs @@ -2167,7 +2167,7 @@ fn send_to_client_v1( message: impl Into, ) { if let Err(e) = client.send_message(tx_offset, OutboundMessage::V1(message.into())) { - tracing::warn!(%client.id, "failed to send update message to client: {e}") + tracing::debug!(%client.id, "failed to send update message to client: {e}") } } fn send_to_client( @@ -2178,7 +2178,7 @@ fn send_to_client( ) { tracing::trace!(client = %client.id, tx_offset, "send_to_client"); if let Err(e) = client.send_message(tx_offset, message) { - tracing::warn!(%client.id, "failed to send update message to client: {e}") + tracing::debug!(%client.id, "failed to send update message to client: {e}") } } diff --git a/crates/datastore/src/locking_tx_datastore/state_view.rs b/crates/datastore/src/locking_tx_datastore/state_view.rs index d1d484fe363..0bc7101cf45 100644 --- a/crates/datastore/src/locking_tx_datastore/state_view.rs +++ b/crates/datastore/src/locking_tx_datastore/state_view.rs @@ -316,7 +316,7 @@ pub trait StateView { } fn get_jwt_payload(&self, connection_id: ConnectionId) -> Result> { - log::info!("Getting JWT payload for connection id: {}", connection_id.to_hex()); + log::trace!("Getting JWT payload for connection id: {}", connection_id.to_hex()); let mut buf: Vec = Vec::new(); self.iter_by_col_eq( ST_CONNECTION_CREDENTIALS_ID, diff --git a/crates/pg/src/pg_server.rs b/crates/pg/src/pg_server.rs index ebca2b61b95..278fca0e9c1 100644 --- a/crates/pg/src/pg_server.rs +++ b/crates/pg/src/pg_server.rs @@ -378,7 +378,7 @@ where let factory_ref = factory.clone(); tokio::spawn(async move { process_socket(stream, None, factory_ref).await.inspect_err(|err|{ - log::error!("PG: Error processing socket: {err:?}"); + log::debug!("PG: Error processing socket: {err:?}"); }) }); } From b7bf57d96330679327ee7398bb1aa7879023bab1 Mon Sep 17 00:00:00 2001 From: clockwork-labs-bot Date: Mon, 15 Jun 2026 20:51:27 -0400 Subject: [PATCH 2/2] Adjust noisy server log cleanup --- crates/client-api/src/routes/subscribe.rs | 2 +- crates/core/src/host/wasm_common/module_host_actor.rs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/client-api/src/routes/subscribe.rs b/crates/client-api/src/routes/subscribe.rs index cc97ccfc961..a57261e950b 100644 --- a/crates/client-api/src/routes/subscribe.rs +++ b/crates/client-api/src/routes/subscribe.rs @@ -504,7 +504,7 @@ async fn ws_client_actor_inner( let _ = unordered_tx.send(msg); }) .await; - log::debug!("Client connection ended: {client_id}"); + log::trace!("Client connection ended: {client_id}"); } /// The main `select!` loop of the websocket client actor. diff --git a/crates/core/src/host/wasm_common/module_host_actor.rs b/crates/core/src/host/wasm_common/module_host_actor.rs index 97d7a3e7fc5..bad234bc1c0 100644 --- a/crates/core/src/host/wasm_common/module_host_actor.rs +++ b/crates/core/src/host/wasm_common/module_host_actor.rs @@ -1710,8 +1710,6 @@ fn log_reducer_error( .with_label_values(&replica_ctx.database_identity, module_hash, reducer) .inc(); - log::info!("reducer returned error: {message}"); - let record = Record { ts: chrono::DateTime::from_timestamp_micros(timestamp.to_micros_since_unix_epoch()).unwrap(), function: Some(reducer),