Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion crates/client-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,);
Expand Down
6 changes: 3 additions & 3 deletions crates/client-api/src/routes/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1232,7 +1232,7 @@ pub async fn pre_publish<S: NodeDelegate + ControlStateDelegate + Authorization>
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 {
Expand All @@ -1256,7 +1256,7 @@ pub async fn pre_publish<S: NodeDelegate + ControlStateDelegate + Authorization>
plan,
major_version_upgrade,
} => {
info!(
debug!(
"planned auto-migration of database {} from {} to {}",
database_identity, old_module_hash, new_module_hash
);
Expand Down
8 changes: 4 additions & 4 deletions crates/client-api/src/routes/subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -668,7 +668,7 @@ async fn ws_main_loop<HotswapWatcher>(

// 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;
},

Expand Down Expand Up @@ -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();
Expand Down
12 changes: 8 additions & 4 deletions crates/core/src/client/client_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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);
Comment thread
bfops marked this conversation as resolved.
})
.abort_handle();

Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/subscription/module_subscription_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,7 @@ fn send_to_client_v1(
message: impl Into<SerializableMessage>,
) {
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(
Expand All @@ -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}")
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/datastore/src/locking_tx_datastore/state_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ pub trait StateView {
}

fn get_jwt_payload(&self, connection_id: ConnectionId) -> Result<Option<String>> {
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<u8> = Vec::new();
self.iter_by_col_eq(
ST_CONNECTION_CREDENTIALS_ID,
Expand Down
2 changes: 1 addition & 1 deletion crates/pg/src/pg_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}");
Comment thread
bfops marked this conversation as resolved.
Outdated
Comment thread
bfops marked this conversation as resolved.
Outdated
})
});
}
Expand Down
Loading